
        /* Theme System - CSS Custom Properties */
        :root {
            /* Default Theme (Slate) */
            --theme-bg-primary: #1a2332;
            --theme-bg-secondary: #1e293b;
            --theme-bg-tertiary: #334155;
            --theme-bg-card: #1e293b;
            --theme-bg-header: #1a2332;
            --theme-bg-modal: #1e293b;
            --theme-bg-sidebar: #1a2332;
            
            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #94a3b8;
            --theme-text-muted: #94a3b8;
            
            --theme-border-primary: #334155;
            --theme-border-secondary: #475569;
            --theme-border-muted: #374151;
            
            --theme-accent: rgb(59, 130, 246);
            --theme-accent-hover: #2563eb;
            --theme-accent-muted: #1d4ed8;
            
            --theme-scrollbar-thumb: #475569;
            --theme-scrollbar-track: rgba(15, 23, 42, 0.3);
            --theme-scrollbar-hover: #64748b;
            
            /* Grid pattern color */
            --theme-grid-color: rgba(255, 255, 255, 0.02);

            /* Shared themed surfaces */
            --theme-context-bg: rgba(15, 23, 42, 0.6);
            --theme-glass-header-bg: rgba(26, 35, 50, 0.8);
            --theme-tooltip-bg: rgba(17, 17, 17, 0.9);
            --theme-poll-choice-bg: rgba(255, 255, 255, 0.025);
            --theme-poll-choice-media-bg: rgba(15, 23, 42, 0.38);

            /* Typography */
            --theme-font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            --theme-font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';

            /*
             * App stacking layers. Keep component-local z-index values below 30
             * so feed controls can never accidentally cover chrome or dialogs.
             */
            --z-local-popover: 20;
            --z-feed-floating: 40;
            --z-settings: 45;
            --z-banner: 48;
            --z-chrome: 50;
            --z-feed-popover: 52;
            --z-thread-modal: 55;
            --z-modal: 60;
            --z-modal-popover: 65;
            --z-system-overlay: 70;
            --z-toast: 80;
        }

        .z-layer-feed-floating { z-index: var(--z-feed-floating); }
        .z-layer-settings { z-index: var(--z-settings); }
        .z-layer-chrome { z-index: var(--z-chrome); }
        .z-layer-feed-popover { z-index: var(--z-feed-popover); }
        .z-layer-modal { z-index: var(--z-modal); }
        .z-layer-modal-popover { z-index: var(--z-modal-popover); }
        .z-layer-system-overlay { z-index: var(--z-system-overlay); }

        /* Dark Theme (Black) - Matching Login Screen */
        .theme-dark {
            --theme-bg-primary: #0a0a0a;
            --theme-bg-secondary: #111111;
            --theme-bg-tertiary: #222222;
            --theme-bg-card: #111111;
            --theme-bg-header: #0a0a0a;
            --theme-bg-modal: #111111;
            --theme-bg-sidebar: #0a0a0a;
            
            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #888888;
            --theme-text-muted: #666666;
            
            --theme-border-primary: #222222;
            --theme-border-secondary: #333333;
            --theme-border-muted: #555555;
            
            /* Neutral blue accent for dark theme (no purple) */
            --theme-accent: #1d9bf0;
            --theme-accent-hover: #2563eb;
            --theme-accent-muted: #1d4ed8;
            
            --theme-scrollbar-thumb: #333333;
            --theme-scrollbar-track: rgba(0, 0, 0, 0.5);
            --theme-scrollbar-hover: #444444;
            
            /* Grid pattern color - slightly more visible on pure black */
            --theme-grid-color: rgba(255, 255, 255, 0.03);

            --theme-context-bg: rgba(10, 10, 10, 0.5);
            --theme-glass-header-bg: rgba(10, 10, 10, 0.85);
            --theme-tooltip-bg: rgba(10, 10, 10, 0.9);
            --theme-poll-choice-bg: rgba(255, 255, 255, 0.02);
            --theme-poll-choice-media-bg: rgba(255, 255, 255, 0.03);
        }

        /* Purple Theme (Elegant Violet) */
        .theme-purple {
            --theme-bg-primary: #150d26;
            --theme-bg-secondary: #1a0f2e;
            --theme-bg-tertiary: #2d1b45;
            --theme-bg-card: #1a0f2e;
            --theme-bg-header: #150d26;
            --theme-bg-modal: #1a0f2e;
            --theme-bg-sidebar: #150d26;
            
            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #c4b5fd;
            --theme-text-muted: #8b5cf6;
            
            --theme-border-primary: #2d1b45;
            --theme-border-secondary: #4c1d95;
            --theme-border-muted: #5b21b6;
            
            --theme-accent: #a855f7;
            --theme-accent-hover: #9333ea;
            --theme-accent-muted: #7c3aed;
            
            --theme-scrollbar-thumb: #4c1d95;
            --theme-scrollbar-track: rgba(15, 10, 26, 0.5);
            --theme-scrollbar-hover: #5b21b6;
            
            /* Grid pattern color - with subtle purple tint */
            --theme-grid-color: rgba(255, 255, 255, 0.025);
            
            --theme-context-bg: rgba(15, 10, 26, 0.5);
            --theme-glass-header-bg: rgba(21, 13, 38, 0.8);
            --theme-tooltip-bg: rgba(21, 13, 38, 0.9);
            --theme-poll-choice-bg: rgba(255, 255, 255, 0.03);
            --theme-poll-choice-media-bg: rgba(255, 255, 255, 0.04);
        }

        .theme-carbon {
            --theme-bg-primary: #0d1014;
            --theme-bg-secondary: #131821;
            --theme-bg-tertiary: #1d2430;
            --theme-bg-card: #131821;
            --theme-bg-header: #0d1014;
            --theme-bg-modal: #131821;
            --theme-bg-sidebar: #0d1014;

            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #a7b0be;
            --theme-text-muted: #778293;

            --theme-border-primary: #1f2833;
            --theme-border-secondary: #2e3947;
            --theme-border-muted: #17202b;

            --theme-accent: #f8fafc;
            --theme-accent-hover: #e2e8f0;
            --theme-accent-muted: #cbd5e1;

            --theme-scrollbar-thumb: #344050;
            --theme-scrollbar-track: rgba(8, 11, 15, 0.58);
            --theme-scrollbar-hover: #445163;
            --theme-grid-color: rgba(255, 255, 255, 0.024);

            --theme-context-bg: rgba(8, 11, 15, 0.58);
            --theme-glass-header-bg: rgba(13, 16, 20, 0.84);
            --theme-tooltip-bg: rgba(9, 12, 16, 0.92);
            --theme-poll-choice-bg: rgba(255, 255, 255, 0.02);
            --theme-poll-choice-media-bg: rgba(255, 255, 255, 0.04);
        }

        .theme-ocean {
            --theme-bg-primary: #081521;
            --theme-bg-secondary: #102435;
            --theme-bg-tertiary: #163348;
            --theme-bg-card: #102435;
            --theme-bg-header: #081521;
            --theme-bg-modal: #102435;
            --theme-bg-sidebar: #081521;

            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #93c5fd;
            --theme-text-muted: #38bdf8;

            --theme-border-primary: #143248;
            --theme-border-secondary: #1d4b69;
            --theme-border-muted: #0d2738;

            --theme-accent: #38bdf8;
            --theme-accent-hover: #0ea5e9;
            --theme-accent-muted: #0284c7;

            --theme-scrollbar-thumb: #1d4b69;
            --theme-scrollbar-track: rgba(8, 21, 33, 0.52);
            --theme-scrollbar-hover: #26678f;
            --theme-grid-color: rgba(186, 230, 253, 0.022);

            --theme-context-bg: rgba(6, 18, 30, 0.56);
            --theme-glass-header-bg: rgba(8, 21, 33, 0.84);
            --theme-tooltip-bg: rgba(8, 21, 33, 0.92);
            --theme-poll-choice-bg: rgba(125, 211, 252, 0.05);
            --theme-poll-choice-media-bg: rgba(56, 189, 248, 0.08);
        }

        .theme-verdant {
            --theme-bg-primary: #0b1712;
            --theme-bg-secondary: #11211a;
            --theme-bg-tertiary: #183126;
            --theme-bg-card: #11211a;
            --theme-bg-header: #0b1712;
            --theme-bg-modal: #11211a;
            --theme-bg-sidebar: #0b1712;

            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #86efac;
            --theme-text-muted: #4ade80;

            --theme-border-primary: #1a3b2d;
            --theme-border-secondary: #25543d;
            --theme-border-muted: #10271d;

            --theme-accent: #22c55e;
            --theme-accent-hover: #16a34a;
            --theme-accent-muted: #15803d;

            --theme-scrollbar-thumb: #25543d;
            --theme-scrollbar-track: rgba(11, 23, 18, 0.54);
            --theme-scrollbar-hover: #2f6f50;
            --theme-grid-color: rgba(220, 252, 231, 0.018);

            --theme-context-bg: rgba(8, 19, 15, 0.56);
            --theme-glass-header-bg: rgba(11, 23, 18, 0.84);
            --theme-tooltip-bg: rgba(11, 23, 18, 0.9);
            --theme-poll-choice-bg: rgba(134, 239, 172, 0.05);
            --theme-poll-choice-media-bg: rgba(34, 197, 94, 0.08);
        }

        .theme-ember {
            --theme-bg-primary: #1a0d08;
            --theme-bg-secondary: #24130d;
            --theme-bg-tertiary: #341d13;
            --theme-bg-card: #24130d;
            --theme-bg-header: #1a0d08;
            --theme-bg-modal: #24130d;
            --theme-bg-sidebar: #1a0d08;

            --theme-text-primary: #e4e4e7;
            --theme-text-secondary: #fdba74;
            --theme-text-muted: #fb923c;

            --theme-border-primary: #4b2416;
            --theme-border-secondary: #6b3117;
            --theme-border-muted: #34180f;

            --theme-accent: #f97316;
            --theme-accent-hover: #ea580c;
            --theme-accent-muted: #c2410c;

            --theme-scrollbar-thumb: #6b3117;
            --theme-scrollbar-track: rgba(26, 13, 8, 0.54);
            --theme-scrollbar-hover: #8b3d1b;
            --theme-grid-color: rgba(255, 237, 213, 0.018);

            --theme-context-bg: rgba(20, 9, 5, 0.56);
            --theme-glass-header-bg: rgba(26, 13, 8, 0.84);
            --theme-tooltip-bg: rgba(26, 13, 8, 0.9);
            --theme-poll-choice-bg: rgba(253, 186, 116, 0.05);
            --theme-poll-choice-media-bg: rgba(249, 115, 22, 0.08);
        }

        /* Modern CSS Reset */
        *, *::before, *::after {
            box-sizing: border-box;
        }
        
        * {
            margin: 0;
            padding: 0;
        }
        
        html {
            scroll-behavior: instant;
        }

        /* Lock viewport to remove global scrollbar */
        html, body {
            height: 100vh;
            overflow: hidden;
        }
        
        body {
            background: var(--theme-bg-primary);
            /* Modern dot pattern - clean and minimal */
            background-image: radial-gradient(circle, var(--theme-grid-color) 1px, transparent 1px);
            background-size: 24px 24px;
            background-attachment: fixed;
            
            
            font-family: var(--theme-font-ui);
            font-feature-settings: var(--theme-font-feature-settings);
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            color: var(--theme-text-primary);
        }

        .font-ui-geist {
            --theme-font-ui: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
            --theme-font-feature-settings: normal;
        }

        .font-ui-system {
            --theme-font-ui: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            --theme-font-feature-settings: normal;
        }

        .font-ui-source {
            --theme-font-ui: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            --theme-font-feature-settings: normal;
        }

        .font-ui-dm {
            --theme-font-ui: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
            --theme-font-feature-settings: normal;
        }

        /* Flex wrapper: header/banners fixed height; feed area scrolls */
        #contentWrapper {
            display: flex;
            flex-direction: column;
            height: 100vh;
            max-height: 100vh;
            overflow: hidden;
            width: 100%;
        }

        /* Ensure non-feed sections never shrink */
        #contentWrapper > header,
        #contentWrapper > footer,
        #contentWrapper > #audioWarningBanner,
        #contentWrapper > #subscriptionWarningBanner {
            flex-shrink: 0;
        }

        /* Scrollable feed viewport */
        #feedScrollContainer {
            flex: 1;
            min-height: 0; /* critical for flex children */
            overflow-y: auto;
            overflow-x: hidden;
            /* Let the browser keep the visible content anchored when items above the
               viewport change height (e.g. lazy media/translations loading). Prepend
               compensation for new top inserts is handled explicitly in feed.js. */
            overflow-anchor: auto;
        }

        #gamesDock {
            flex-shrink: 0;
        }

        .games-dock-bar {
            position: relative;
            overflow: hidden;
            border-bottom: 1px solid var(--theme-border-primary);
            background: var(--theme-bg-card);
        }

        #gamesMenuView:not(.hidden) {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.35rem 0.6rem;
        }

        .games-menu-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.55rem;
            height: 1.55rem;
            border-radius: 0.4rem;
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(96, 165, 250, 0.12);
            color: #93c5fd;
            flex-shrink: 0;
        }

        .games-menu-items {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            flex: 1;
            min-width: 0;
        }

        .games-menu-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.28rem 0.5rem;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 0.4rem;
            background: rgba(255, 255, 255, 0.03);
            color: var(--theme-text-secondary);
            font-family: inherit;
            font-size: 0.7rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
            white-space: nowrap;
        }

        .games-menu-btn:hover {
            background: rgba(59, 130, 246, 0.1);
            border-color: rgba(96, 165, 250, 0.25);
            color: var(--theme-text-primary);
            transform: translateY(-1px);
        }

        .games-menu-btn.is-active {
            background: rgba(59, 130, 246, 0.15);
            border-color: rgba(96, 165, 250, 0.4);
            color: var(--theme-text-primary);
        }

        .games-menu-btn svg {
            opacity: 0.4;
            transition: opacity 120ms ease;
        }

        .games-menu-btn:hover svg {
            opacity: 0.7;
        }

        .games-menu-dot {
            width: 0.35rem;
            height: 0.35rem;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .games-menu-dot--blue {
            background: #60a5fa;
            box-shadow: 0 0 6px rgba(96, 165, 250, 0.5);
        }

        .games-menu-dot--green {
            background: #4ade80;
            box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
        }

        .games-menu-dot--amber {
            background: #f59e0b;
            box-shadow: 0 0 6px rgba(245, 158, 11, 0.52);
        }

        .games-menu-dot--violet {
            background: #a78bfa;
            box-shadow: 0 0 6px rgba(167, 139, 250, 0.54);
        }

        .games-menu-dot--red {
            background: #f87171;
            box-shadow: 0 0 6px rgba(248, 113, 113, 0.54);
        }

        .games-menu-close {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.5rem;
            height: 1.5rem;
            border: none;
            border-radius: 0.375rem;
            background: transparent;
            color: var(--theme-text-muted);
            cursor: pointer;
            transition: background 120ms ease, color 120ms ease;
            flex-shrink: 0;
            margin-left: auto;
        }

        .games-menu-close:hover {
            background: rgba(255, 255, 255, 0.06);
            color: var(--theme-text-primary);
        }

        .games-game-view:not(.hidden) {
            display: flex;
            height: 100%;
        }

        #gamesDock.games-active .games-dock-bar {
            height: clamp(118px, 14vh, 164px);
        }

        .games-panel {
            width: 100%;
        }

        #gamesDock.games-active .games-panel {
            height: 100%;
        }

        /* Feed container scrollbar styling */
        #feedScrollContainer::-webkit-scrollbar { width: 6px; height: 6px; }
        #feedScrollContainer::-webkit-scrollbar-track { background: var(--theme-scrollbar-track); }
        #feedScrollContainer::-webkit-scrollbar-thumb {
            background: var(--theme-scrollbar-thumb);
            border-radius: 3px;
            border: 1px solid var(--theme-border-primary);
        }
        #feedScrollContainer::-webkit-scrollbar-thumb:hover {
            background: var(--theme-scrollbar-hover);
            border-color: var(--theme-border-secondary);
        }
        #feedScrollContainer { scrollbar-width: thin; scrollbar-color: var(--theme-scrollbar-thumb) var(--theme-scrollbar-track); }
        
         /* Custom scrollbar for all elements */
         ::-webkit-scrollbar {
             width: 6px;
             height: 6px;
         }
         
         ::-webkit-scrollbar-track {
             background: var(--theme-scrollbar-track);
             border-radius: 3px;
         }
         
         ::-webkit-scrollbar-thumb {
             background: var(--theme-scrollbar-thumb);
             border-radius: 3px;
             border: 1px solid var(--theme-border-primary);
             transition: all 0.3s ease;
         }
         
         ::-webkit-scrollbar-thumb:hover {
             background: var(--theme-scrollbar-hover);
             border-color: var(--theme-border-secondary);
             box-shadow: 0 0 8px rgba(100, 116, 139, 0.3);
         }
         
         ::-webkit-scrollbar-thumb:active {
             background: var(--theme-scrollbar-hover);
         }
         
         ::-webkit-scrollbar-corner {
             background: var(--theme-scrollbar-track);
         }
         
         /* Firefox support */
         * {
             scrollbar-width: thin;
             scrollbar-color: var(--theme-scrollbar-thumb) var(--theme-scrollbar-track);
         }
         
         /* Enhanced scrollbar for specific containers */
         .custom-scrollbar::-webkit-scrollbar {
             width: 8px;
             height: 8px;
         }
         
        .custom-scrollbar::-webkit-scrollbar-thumb {
             background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
             border-radius: 4px;
             border: 1px solid rgba(99, 102, 241, 0.3);
        }
         
        .custom-scrollbar::-webkit-scrollbar-thumb:hover {
             background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
             box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
        }

        /* Monitored accounts table */
        .accounts-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.875rem;
            padding: 0.625rem;
            border: 1px solid var(--theme-border-primary);
            border-radius: 0.75rem;
            background: rgba(255, 255, 255, 0.018);
        }

        .accounts-filter-group,
        .accounts-bulk-actions {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .accounts-search {
            flex: 1 1 18rem;
            min-width: 13rem;
        }

        .accounts-search-input {
            font-size: 0.75rem;
            line-height: 1rem;
        }

        .accounts-filter-group {
            flex: 0 0 auto;
            padding: 0.2rem;
            border: 1px solid var(--theme-border-primary);
            border-radius: 0.625rem;
            background: rgba(0, 0, 0, 0.12);
        }

        .accounts-bulk-actions {
            justify-content: flex-end;
            padding: 0 0.125rem;
        }

        .accounts-table-shell {
            overflow: hidden;
            border: 1px solid var(--theme-border-primary);
            border-radius: 0.75rem;
            background: rgba(255, 255, 255, 0.014);
        }

        .accounts-table-scroll {
            max-height: min(32rem, calc(100vh - 21rem));
            overflow: auto;
            contain: paint;
        }

        .accounts-table {
            width: 100%;
            min-width: 28rem;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: 0.8125rem;
        }

        .accounts-table td {
            padding: 0.42rem 0.75rem;
            border-bottom: 1px solid rgba(148, 163, 184, 0.12);
            color: var(--theme-text-secondary);
            vertical-align: middle;
        }

        .accounts-table td:last-child {
            width: 7.25rem;
        }

        .accounts-table tr:last-child td {
            border-bottom: 0;
        }

        .accounts-table tbody tr:hover {
            background: rgba(255, 255, 255, 0.032);
        }

        .account-handle-link {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            max-width: 100%;
            color: var(--theme-text-primary);
            font-size: 0.8125rem;
            font-weight: 600;
            line-height: 1.15;
        }

        .account-handle-link:hover {
            color: rgb(255 255 255 / 0.94);
        }

        .account-handle-link svg {
            flex: 0 0 auto;
            opacity: 0.45;
        }

        .account-new-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            border-radius: 0.375rem;
            border: 1px solid transparent;
            font-size: 0.6875rem;
            font-weight: 600;
            line-height: 1;
        }

        .account-new-badge {
            padding: 0.25rem 0.375rem;
            border-color: rgba(34, 197, 94, 0.28);
            background: rgba(34, 197, 94, 0.1);
            color: rgb(74 222 128);
            letter-spacing: 0.04em;
        }

        .account-action-group {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.375rem;
        }

        .account-action-button,
        .account-customize-button,
        .account-visibility-button,
        .accounts-page-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--theme-border-primary);
            border-radius: 0.45rem;
            background: rgba(255, 255, 255, 0.035);
            color: var(--theme-text-muted);
            cursor: pointer;
            transition: background-color 80ms ease, border-color 80ms ease, color 80ms ease, transform 80ms ease;
        }

        .account-action-button,
        .account-customize-button,
        .account-visibility-button {
            width: 1.75rem;
            height: 1.75rem;
            flex-shrink: 0;
        }

        .account-action-button:hover,
        .account-customize-button:hover,
        .account-visibility-button:hover,
        .accounts-page-btn:hover:not(:disabled) {
            border-color: rgba(165, 180, 252, 0.35);
            background: rgba(255, 255, 255, 0.065);
            color: var(--theme-text-primary);
        }

        .account-action-button:active,
        .account-customize-button:active,
        .account-visibility-button:active,
        .accounts-page-btn:active:not(:disabled) {
            transform: translateY(1px);
        }

        .account-visibility-button[data-state="on"] {
            color: rgb(165 180 252);
        }

        .account-visibility-button[data-state="off"] {
            color: var(--theme-text-muted);
        }

        .account-remove-button:hover {
            border-color: rgba(248, 113, 113, 0.32);
            background: rgba(239, 68, 68, 0.1);
            color: rgb(248 113 113);
        }

        .accounts-pagination {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: nowrap;
            min-height: 3.25rem;
            padding: 0.65rem 0.75rem;
            border-top: 1px solid var(--theme-border-primary);
            background: rgba(0, 0, 0, 0.12);
        }

        .accounts-page-summary {
            flex: 1 1 auto;
            min-width: 7rem;
            color: var(--theme-text-muted);
            font-size: 0.75rem;
            font-variant-numeric: tabular-nums;
        }

        .accounts-page-controls {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            flex: 0 0 auto;
        }

        .accounts-page-btn {
            min-width: 2rem;
            height: 2rem;
            padding: 0 0.55rem;
            font-size: 0.8125rem;
            font-weight: 600;
            line-height: 1;
        }

        .accounts-page-btn.is-active {
            border-color: rgba(165, 180, 252, 0.36);
            background: rgba(99, 102, 241, 0.16);
            color: var(--theme-text-primary);
        }

        .accounts-page-btn:disabled {
            cursor: default;
            opacity: 0.42;
        }

        .accounts-page-ellipsis {
            padding: 0 0.35rem;
            color: var(--theme-text-muted);
            font-size: 0.8125rem;
        }

        @media (max-width: 900px) {
            .accounts-toolbar {
                align-items: stretch;
                flex-direction: column;
            }

            .accounts-search {
                flex-basis: auto;
                min-width: 0;
            }

            .accounts-filter-group,
            .accounts-bulk-actions {
                flex-wrap: wrap;
            }

        }

        @media (max-width: 420px) {
            .accounts-pagination {
                align-items: flex-start;
                flex-direction: column;
            }

            .accounts-page-controls {
                flex-wrap: wrap;
            }
        }

        /* Account Filter Buttons */
        .accounts-filter-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 4.5rem;
            padding: 0.4rem 0.65rem;
            font-size: 0.75rem;
            font-weight: 600;
            border-radius: 0.45rem;
            border: 1px solid transparent;
            background-color: transparent;
            color: rgba(156, 163, 175, 0.8);
            cursor: pointer;
            transition: background-color 80ms ease, border-color 80ms ease, color 80ms ease;
        }

        .accounts-filter-btn:hover {
            background-color: rgba(255, 255, 255, 0.05);
            color: rgba(156, 163, 175, 1);
        }

        .accounts-filter-btn.active {
            background-color: rgba(99, 102, 241, 0.16);
            border-color: rgba(99, 102, 241, 0.32);
            color: rgb(165 180 252);
        }

        /* Settings / bulk action buttons */
        .settings-action-btn,
        .bulk-action-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            min-height: 2rem;
            padding: 0.4rem 0.7rem;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1;
            border-radius: 0.45rem;
            border: 1px solid var(--theme-border-primary);
            background: rgba(255, 255, 255, 0.035);
            color: var(--theme-text-muted);
            cursor: pointer;
            transition: background-color 80ms ease, border-color 80ms ease, color 80ms ease, transform 80ms ease;
        }

        .settings-action-btn svg,
        .bulk-action-btn svg {
            flex: 0 0 auto;
        }

        .settings-action-primary,
        .bulk-action-enable {
            color: rgb(165 180 252);
        }

        .settings-action-btn:hover,
        .bulk-action-btn:hover {
            border-color: rgba(165, 180, 252, 0.35);
            background: rgba(255, 255, 255, 0.065);
            color: var(--theme-text-primary);
        }

        .settings-action-primary:hover,
        .bulk-action-enable:hover {
            color: rgb(199 210 254);
        }

        .settings-action-muted,
        .bulk-action-disable {
            color: var(--theme-text-muted);
        }

        .settings-action-muted:hover,
        .bulk-action-disable:hover {
            color: rgb(203 213 225);
        }

        .settings-action-danger:hover {
            border-color: rgba(248, 113, 113, 0.32);
            background: rgba(239, 68, 68, 0.1);
            color: rgb(248 113 113);
        }

        .settings-action-block {
            width: 100%;
            min-height: 2.35rem;
        }

        .settings-action-icon {
            width: 2rem;
            height: 2rem;
            padding: 0;
            flex-shrink: 0;
        }

        .settings-action-btn:disabled {
            cursor: not-allowed;
            opacity: 0.48;
            transform: none;
        }

        .settings-action-btn:focus-visible,
        .bulk-action-btn:focus-visible {
            outline: 2px solid rgba(165, 180, 252, 0.65);
            outline-offset: 2px;
        }

        .settings-action-btn:active:not(:disabled),
        .bulk-action-btn:active {
            transform: translateY(1px);
        }

        .appearance-panel {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.008));
            padding: 0.85rem;
            border-radius: 0.75rem;
        }

        .appearance-panel.space-y-5 > :not([hidden]) ~ :not([hidden]) {
            margin-top: 0.85rem;
        }

        .appearance-current {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.65rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--theme-border-primary);
        }

        .appearance-current-copy {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            min-width: 0;
        }

        .appearance-current-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 2rem;
            border-radius: 0.65rem;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--theme-border-primary);
            color: var(--theme-text-secondary);
            flex-shrink: 0;
        }

        .appearance-current-label {
            display: block;
            font-size: 0.66rem;
            color: var(--theme-text-secondary);
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .appearance-current-name {
            display: block;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--theme-text-primary);
            margin-top: 0.05rem;
        }

        .appearance-current-detail {
            margin-top: 0.05rem;
            font-size: 0.74rem;
            color: var(--theme-text-secondary);
        }

        .appearance-token-row {
            display: flex;
            align-items: center;
            gap: 0.32rem;
            flex-shrink: 0;
        }

        .appearance-token {
            width: 1.05rem;
            height: 1.05rem;
            border-radius: 999px;
            border: 1px solid var(--theme-border-primary);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        }

        .appearance-group {
            display: flex;
            flex-direction: column;
            gap: 0.45rem;
        }

        .appearance-group-copy {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }

        .appearance-group-title {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--theme-text-primary);
        }

        .appearance-group-description {
            font-size: 0.7rem;
            color: var(--theme-text-secondary);
        }

        .font-options-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
            gap: 0.45rem;
        }

        .theme-options-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
            gap: 0.45rem;
        }

        .font-size-options-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.45rem;
        }

        .card-style-options-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.45rem;
        }

        .font-option,
        .theme-option,
        .font-size-option,
        .card-style-option {
            position: relative;
            appearance: none;
            border: 1px solid var(--theme-border-primary);
            background: var(--theme-bg-secondary);
            border-radius: 0.95rem;
            font: inherit;
            color: inherit;
            transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
        }

        .font-option:focus-visible,
        .theme-option:focus-visible,
        .font-size-option:focus-visible,
        .card-style-option:focus-visible {
            outline: 2px solid var(--theme-accent);
            outline-offset: 2px;
        }

        .font-option:hover,
        .theme-option:hover,
        .font-size-option:hover,
        .card-style-option:hover {
            border-color: var(--theme-border-secondary);
            background: var(--theme-bg-tertiary);
        }

        .font-option.selected,
        .theme-option.selected,
        .font-size-option.selected,
        .card-style-option.selected {
            border-color: var(--theme-accent);
            background: var(--theme-bg-tertiary);
            box-shadow: 0 0 0 1px var(--theme-accent);
        }

        /* Card-style picker (Modern / Classic) */
        .card-style-option {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
            padding: 0.6rem 0.6rem 0.65rem;
            text-align: left;
            cursor: pointer;
        }

        .card-style-option-label {
            font-size: 0.74rem;
            font-weight: 600;
            color: var(--theme-text-primary);
            line-height: 1.2;
        }

        /* Tiny schematic card drawn entirely with borders so each option
           communicates its own look (thick left edge vs even all-around). */
        .card-style-chip {
            width: 100%;
            height: 1.75rem;
            border-radius: 4px;
            background: var(--theme-bg-card);
            border: 1px solid var(--theme-border-secondary);
        }
        .card-style-chip--modern {
            border-left: 3px solid var(--theme-accent);
            border-radius: 0 4px 4px 0;
        }
        .card-style-chip--classic {
            border: 1px solid var(--theme-accent);
            border-radius: 4px;
        }

        .font-size-option {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.3rem;
            padding: 0.6rem 0.45rem;
            min-height: 3.45rem;
            text-align: center;
            cursor: pointer;
        }

        .font-size-option-preview {
            font-weight: 700;
            line-height: 1;
            color: var(--theme-text-primary);
        }

        .font-size-option-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--theme-text-primary);
            line-height: 1.2;
        }

        .font-option {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.55rem 0.6rem;
            text-align: left;
            cursor: pointer;
        }

        .font-option-badge {
            width: 1.55rem;
            height: 1.55rem;
            border-radius: 0.5rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--theme-border-primary);
            color: var(--theme-text-secondary);
            font-size: 0.72rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .font-option-copy {
            min-width: 0;
            flex: 1;
        }

        .font-option-name {
            display: block;
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--theme-text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .font-option-description {
            display: none;
            font-size: 0.76rem;
            line-height: 1.35;
            color: var(--theme-text-secondary);
            margin-top: 0.2rem;
        }

        .theme-option {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.38rem;
            padding: 0.55rem 0.45rem;
            min-height: 3.45rem;
            text-align: center;
            cursor: pointer;
        }

        .theme-option-swatches {
            display: flex;
            gap: 0.22rem;
        }

        .theme-option-swatch {
            width: 0.75rem;
            height: 0.75rem;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
        }

        .theme-option-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--theme-text-primary);
            line-height: 1.2;
        }

        .appearance-option-check {
            position: absolute;
            top: 0.4rem;
            right: 0.4rem;
            width: 0.9rem;
            height: 0.9rem;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--theme-accent);
            color: var(--theme-bg-primary);
            opacity: 0;
            transform: scale(0.8);
            transition: opacity 160ms ease, transform 160ms ease;
            pointer-events: none;
        }

        .font-option.selected .appearance-option-check,
        .theme-option.selected .appearance-option-check,
        .font-size-option.selected .appearance-option-check,
        .card-style-option.selected .appearance-option-check {
            opacity: 1;
            transform: scale(1);
        }

        /* ── Live appearance preview ───────────────────────────────────
           Sticky mini-feed that reflects the CURRENT font, text size, theme
           and card style. It is built from real .tweet-card markup, so theme
           (body class), font (body class), text size (html .fs-*) and card
           style (html .card-*) all cascade into it automatically. */
        .appearance-preview {
            position: sticky;
            top: 0;
            z-index: 3;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            padding: 0.55rem;
            border-radius: 0.75rem;
            border: 1px solid var(--theme-border-primary);
            background: var(--theme-bg-primary);
        }

        .appearance-preview-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .appearance-preview-title {
            font-size: 0.66rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--theme-text-secondary);
        }

        /* Neutralize the .tweet-card feed margins inside the compact preview. */
        .appearance-preview .tweet-card {
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            contain: layout style;
        }
        .appearance-preview .tweet-card + .tweet-card {
            margin-top: 0.4rem !important;
        }

        .appearance-preview-card-inner {
            display: flex;
            gap: 0.5rem;
            padding: 0.5rem 0.6rem;
            align-items: flex-start;
        }
        .appearance-preview-avatar {
            width: 1.85rem;
            height: 1.85rem;
            border-radius: 999px;
            flex-shrink: 0;
            background: linear-gradient(135deg, var(--theme-accent), var(--theme-border-secondary));
        }
        .appearance-preview-body { min-width: 0; flex: 1; }
        .appearance-preview-name {
            font-weight: 600;
            color: var(--theme-text-primary);
            line-height: 1.2;
        }
        .appearance-preview-handle { color: var(--theme-text-secondary); }
        .appearance-preview-text {
            margin-top: 0.15rem;
            color: #c5c8cf;
            line-height: 1.35;
        }

        /* Custom Theme Classes to Replace Tailwind */
        .theme-bg-primary {
            background-color: var(--theme-bg-primary) !important;
        }
        
        .theme-bg-secondary {
            background-color: var(--theme-bg-secondary) !important;
        }
        
        .theme-bg-tertiary {
            background-color: var(--theme-bg-tertiary) !important;
        }
        
        .theme-bg-modal {
            background-color: var(--theme-bg-modal) !important;
        }
        
        .theme-bg-sidebar {
            background-color: var(--theme-bg-sidebar) !important;
        }
        
        .theme-border-primary,
        .theme-border-primary.theme-border-primary {
            border-color: var(--theme-border-primary) !important;
        }
        
        .theme-border-secondary,
        .theme-border-secondary.theme-border-secondary {
            border-color: var(--theme-border-secondary) !important;
        }
        
        .theme-text-primary {
            color: var(--theme-text-primary) !important;
        }
        
        .theme-text-secondary {
            color: var(--theme-text-secondary) !important;
        }
        
        .theme-text-muted {
            color: var(--theme-text-muted) !important;
        }
        
        /* Theme-aware semi-transparent backgrounds for context containers */
        .theme-bg-context {
            background: var(--theme-context-bg);
        }
        
        .theme-bg-context-blue {
            background: rgba(30, 58, 138, 0.3);
        }
        
        /* Reply context containers (top-level replies) */
        .reply-context-container {
            border-top: none;
            border-right: none;
            border-bottom: none;
            border-left: 2px solid var(--theme-accent);
        }
        
        /* Retweet context containers (top-level retweets) */
        .retweet-context-container {
            border-top: none;
            border-right: none;
            border-bottom: none;
            border-left: 2px solid #10b981;
        }
        
        .theme-border-context-blue {
            border-color: rgba(29, 78, 216, 0.3);
        }
        
        /* Nested context styling - using theme colors */
        .nested-context-outer {
            background: var(--theme-bg-secondary);
            border: 1px solid var(--theme-border-primary);
            border-left: 3px solid var(--theme-border-primary);
            margin-left: 1.5rem;
            margin-top: 0.75rem;
            position: relative;
        }
        
        .nested-context-outer::before {
            display: none; /* Remove weird line */
        }
        
        .nested-context-inner {
            background: var(--theme-bg-secondary);
            border: 1px solid var(--theme-border-primary);
            border-left: 3px solid var(--theme-border-primary);
            margin-left: 1.5rem;
            margin-top: 0.75rem;
            position: relative;
        }
        
        .nested-context-inner::before {
            display: none; /* Remove weird line */
        }
        
        /* Performance-focused minimal animations */
        .pulse-dot {
            animation: pulse-dot 2s ease-in-out infinite;
        }
        @keyframes pulse-dot {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.4; }
        }
        

        
        /* Modern header buttons inspired by sidebar design */
        .header-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            height: 32px;
            font-size: 14px;
            font-weight: 500;
            transition: all 150ms ease;
            padding: 10px 12px;
            border-radius: 8px;
            border: 1px solid transparent;
            cursor: pointer;
            outline: none;
            text-decoration: none;
        }
        
        .header-btn svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }
        
        .header-btn.inactive {
            color: var(--theme-text-secondary);
            border-color: transparent;
        }
        
        .header-btn.inactive:hover {
            color: var(--theme-text-primary);
            background-color: var(--theme-bg-secondary);
            border-color: var(--theme-border-muted);
        }
        
        .header-btn.active {
            background-color: var(--theme-bg-secondary);
            color: var(--theme-accent);
            border-color: rgba(255, 255, 255, 0.2);
        }
        /* Ensure users button uses white in dark theme */
        .theme-dark #usersButton.active,
        .theme-dark #usersButton.inactive {
            color: var(--theme-text-primary);
        }
        
        .header-btn.active:hover {
            background-color: var(--theme-bg-tertiary);
        }
        
        /* Small users button next to NIGGATRON */
        .users-btn-small {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            height: auto;
            font-size: 14px;
            font-weight: 500;
            transition: all 150ms ease;
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid transparent;
            cursor: pointer;
            outline: none;
            text-decoration: none;
            background: none;
            /* Match the footer's secondary utility text (connection status) on every theme */
            color: var(--theme-text-secondary);
        }
        
        .users-btn-small svg {
            width: 12px;
            height: 12px;
            flex-shrink: 0;
        }
        
        .users-btn-small.active {
            background-color: var(--theme-bg-secondary);
            color: var(--theme-accent);
            border-color: rgba(255, 255, 255, 0.2);
        }
        
        /* Connection status indicator */
        .connection-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .connection-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #ef4444; /* Red by default (disconnected) */
            transition: background-color 0.3s ease;
        }
        
        .connection-dot.connected {
            background-color: #22c55e; /* Green when connected */
        }
        
        .connection-dot.connecting {
            background-color: #f59e0b; /* Orange when connecting */
            animation: pulse 1.5s ease-in-out infinite;
        }

        .ws-reconnect-overlay {
            position: fixed;
            inset: 0;
            z-index: var(--z-system-overlay);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(2, 6, 23, 0.74);
            backdrop-filter: blur(10px);
        }

        .ws-reconnect-overlay.hidden {
            display: none;
        }

        .ws-reconnect-card {
            width: min(100%, 420px);
            padding: 28px 24px 22px;
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background:
                radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 55%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
            text-align: center;
        }

        .ws-reconnect-kicker {
            margin-bottom: 10px;
            color: rgba(148, 163, 184, 0.9);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .ws-reconnect-title {
            margin: 0;
            color: #f8fafc;
            font-size: 24px;
            line-height: 1.15;
            font-weight: 700;
        }

        .ws-reconnect-copy {
            margin: 12px 0 0;
            color: rgba(226, 232, 240, 0.82);
            font-size: 14px;
            line-height: 1.6;
        }

        .ws-reconnect-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 132px;
            min-height: 42px;
            margin-top: 18px;
            padding: 0 18px;
            border: 1px solid rgba(96, 165, 250, 0.28);
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.18));
            color: #eff6ff;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.01em;
            transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
        }

        .ws-reconnect-button:hover {
            transform: translateY(-1px);
            border-color: rgba(96, 165, 250, 0.45);
            background: linear-gradient(180deg, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.24));
        }

        .ws-reconnect-button:focus-visible {
            outline: 2px solid rgba(147, 197, 253, 0.45);
            outline-offset: 3px;
        }

        .ws-reconnect-countdown {
            margin: 12px 0 0;
            color: rgba(148, 163, 184, 0.7);
            font-size: 12px;
            min-height: 16px;
        }

        /* Access-revoked / subscription-ended variant uses a red accent */
        .session-ended-overlay .ws-reconnect-card {
            background:
                radial-gradient(circle at top, rgba(239, 68, 68, 0.14), transparent 55%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
        }

        .session-ended-overlay .ws-reconnect-kicker {
            color: rgba(248, 113, 113, 0.95);
        }

        .session-ended-overlay .ws-reconnect-button {
            border-color: rgba(248, 113, 113, 0.32);
            background: linear-gradient(180deg, rgba(239, 68, 68, 0.24), rgba(220, 38, 38, 0.2));
            color: #fef2f2;
        }

        .session-ended-overlay .ws-reconnect-button:hover {
            border-color: rgba(248, 113, 113, 0.5);
            background: linear-gradient(180deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.26));
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        /* Settings dropdown menu items */
        .settings-dropdown-item {
            transition: all 0.15s ease;
        }
        
        .settings-dropdown-item:hover {
            background-color: var(--theme-bg-tertiary);
        }
        
        .settings-dropdown-item:hover svg {
            opacity: 1;
        }
        
        .settings-dropdown-item svg {
            opacity: 0.6;
            transition: opacity 0.15s ease;
        }
        
        .settings-dropdown-item:active {
            opacity: 0.8;
        }
        
        .settings-dropdown-item.text-red-400:hover {
            background-color: rgba(248, 113, 113, 0.1);
        }
        
        .settings-dropdown-item.text-red-400 svg {
            opacity: 0.8;
        }
        
        /* Modern toggle switch */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #475569;
            transition: .2s;
            border-radius: 24px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: .2s;
            border-radius: 50%;
        }
        
        input:checked + .toggle-slider {
            background-color: #3b82f6;
        }
        
        input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }
        
        /* User tracking highlight styles */
        /* These rules define the MODERN (default) highlight look. The .card-classic
           overrides further below restyle them for the Classic card setting.
           Tracking recolors the border via currentColor (set inline in JS as the
           card's `color`); the gradient ::before also reads currentColor. */
        /* Regular priority: tracked-color left border + a very subtle gradient wash. */
        .tracked-user-highlight {
            border-left: 3px solid !important;
            border-radius: inherit;
            position: relative;
        }

        .tracked-user-highlight::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to right, currentColor, transparent);
            opacity: 0.06;
            pointer-events: none;
            border-radius: inherit;
        }

        /* High/ultra priority: same left border + stronger gradient wash, plus a
           tracked-color inner edge glow and soft drop shadow. */
        .tracked-user-high-priority,
        .tracked-user-ultra-priority {
            border-left: 3px solid !important;
            border-radius: inherit;
            position: relative;
            box-shadow:
                inset 4px 0 20px color-mix(in srgb, currentColor 20%, transparent),
                0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px rgba(0, 0, 0, 0.05);
        }

        .tracked-user-high-priority::before,
        .tracked-user-ultra-priority::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to right, currentColor, transparent);
            opacity: 0.09;
            pointer-events: none;
            border-radius: inherit;
        }

        /* ============================================================
           CLASSIC card style (Settings ▸ General ▸ Theme ▸ Card style).
           Class lives on <html>. Prioritizes an even all-around border.
             • base card    → uniform 1px border, symmetric 3px radius
             • tracked      → 1px tracked-color border on ALL sides, NO gradient
             • high / ultra → 2px tracked-color border on ALL sides + gradient,
                              no drop shadow/glow
           Tracked border color comes from currentColor (inline `color` in JS). */
        .card-classic .tweet-card {
            border-width: 1px;
            border-radius: 3px;
        }
        .card-classic .tracked-user-highlight {
            border: 1px solid !important;
        }
        /* Normal-priority tracked: border only, drop the gradient wash. */
        .card-classic .tracked-user-highlight::before {
            display: none;
        }
        .card-classic .tracked-user-high-priority,
        .card-classic .tracked-user-ultra-priority {
            border: 2px solid !important;
            box-shadow: none;
        }

        /* Keep author names in default color, not highlighted */
        .tracked-user-name {
            color: inherit !important;
        }
        
        /* Preserve accent colors in follow card enhanced data even when card is highlighted */
        .tracked-user-highlight .text-accent-400,
        .tracked-user-high-priority .text-accent-400,
        .tracked-user-ultra-priority .text-accent-400 {
            color: rgb(251 191 36) !important; /* Keep accent-400 color */
        }
        
        /* Ensure external link and translate button stay clickable above highlight overlays */
        .tweet-external-link,
        .tweet-translate-btn,
        .chat-translate-btn {
            z-index: 5;
            pointer-events: auto;
        }
        
        /* Pinned tweet classes are handled in JS for positioning only - no visual styling */
        
        /* Pinned action line - emphasize importance */
        .pinned-action-line {
            background: rgba(251, 191, 36, 0.08);
            border: 1px solid rgba(251, 191, 36, 0.22);
            border-left-width: 3px;
            border-left-color: #fbbf24;
            color: #fbbf24 !important;
            padding: 6px 10px;
            border-radius: 10px;
            font-weight: 600;
            opacity: 1 !important;
        }
        .pinned-action-line .timestamp {
            color: var(--theme-text-secondary) !important;
            font-weight: 500;
        }
        .pinned-action-line .dot-separator {
            color: var(--theme-text-secondary) !important;
        }
        /* Layout-stable timestamps: avoid ripple on text updates */
        .timestamp {
            display: inline-block;
            min-width: 12ch;                 /* stable width across labels */
            font-variant-numeric: tabular-nums;
            contain: layout style paint;      /* isolate layout/paint */
        }
        .pinned-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 2px 8px;
            background: rgba(251, 191, 36, 0.15);
            border: 1px solid rgba(251, 191, 36, 0.35);
            color: #fbbf24;
            border-radius: 9999px;
            font-size: var(--feed-fs-3xs);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        /* Unpinned action line - similar layout, less urgent color */
        .unpinned-action-line {
            background: rgba(148, 163, 184, 0.06); /* slate-400-ish, subtle */
            border: 1px solid rgba(148, 163, 184, 0.20);
            border-left-width: 3px;
            border-left-color: rgba(148, 163, 184, 0.6);
            color: rgba(148, 163, 184, 0.95) !important;
            padding: 6px 10px;
            border-radius: 10px;
            font-weight: 600;
            opacity: 1 !important;
        }
        .unpinned-action-line .timestamp {
            color: var(--theme-text-secondary) !important;
            font-weight: 500;
        }
        .unpinned-action-line .dot-separator {
            color: var(--theme-text-secondary) !important;
        }
        .unpinned-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 2px 8px;
            background: rgba(148, 163, 184, 0.12);
            border: 1px solid rgba(148, 163, 184, 0.28);
            color: rgba(148, 163, 184, 0.95);
            border-radius: 9999px;
            font-size: var(--feed-fs-3xs);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        
        /* Follow/Unfollow action border effects */
        .follow-glow {
            border: 2px solid rgba(34, 197, 94, 0.4) !important;
        }
        
        .unfollow-glow {
            border: 2px solid rgba(239, 68, 68, 0.4) !important;
        }

        .follow-preview-shell {
            padding: 0.5rem;
        }

        .follow-preview-card {
            border-radius: 0 3px 3px 0;
            overflow: hidden;
            border: 1px solid rgba(148, 163, 184, 0.14);
            border-left-width: 3px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        .follow-preview-card.follow-preview-follow {
            border-left-color: rgba(34, 197, 94, 0.565);
        }

        .follow-preview-card.follow-preview-unfollow {
            border-left-color: rgba(239, 68, 68, 0.565);
        }

        .follow-preview-card.follow-preview-update {
            border-left-color: rgba(96, 165, 250, 0.565);
        }

        .follow-preview-banner {
            height: 78px;
        }

        .follow-preview-banner .follow-preview-banner-controls {
            display: none;
        }

        .follow-preview-banner:hover .follow-preview-banner-controls {
            display: flex;
        }

        .follow-preview-banner-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 4px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
        }

        .follow-preview-banner-button:hover {
            background: rgba(0, 0, 0, 0.9);
        }

        .follow-preview-avatar-link {
            bottom: -1.1rem;
            left: 0.75rem;
        }

        .follow-preview-avatar {
            width: 58px;
            height: 58px;
        }

        .follow-preview-body {
            padding: 1.25rem 0.75rem 0.75rem;
        }

        .follow-preview-body .mt-3 {
            margin-top: 0.375rem;
        }

        .follow-preview-body .flex-wrap {
            row-gap: 0.25rem;
        }

        /* Volume slider styling */
        #volumeControl::-webkit-slider-thumb {
            appearance: none;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
        }
        
        #volumeControl::-moz-range-thumb {
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            border: none;
        }
        
        /* Modern card styles */
        .tweet-card {
            --tweet-card-pad: 0.55rem;
            --tweet-card-gap: 0.55rem;
            background: var(--theme-bg-card);
            border: 1px solid var(--theme-border-primary);
            border-left-width: 3px;
            border-radius: 0px 3px 3px 0px;
            overflow: hidden;
            position: relative;
            contain: layout style paint;
            margin-top: 0.75rem !important;
            margin-bottom: 0.75rem !important;
        }
        

        /* ============================================================
           FEED FONT-SIZE TOKENS (single source of truth)
           Every feed item (tweets, follows, profile updates, external
           providers, polls, cards, badges, CA/token bars, chat) sizes
           text through these tokens via the .fs-* utility classes below.

           "Text size" is a user setting (Settings > Appearance). Each
           preset redefines the 8 tiers with hand-picked INTEGER px so
           glyphs stay crisp (no sub-pixel blur) and every tier can be
           tuned independently. feed-settings.js toggles the preset class
           (fs-small | fs-default | fs-large) on <html>; bare :root falls
           back to the "default" preset so first paint already matches the
           common case. Add a 4th preset by adding one block + one option.
           Line-heights are unitless on .fs-* so they track each preset. */
        :root,
        :root.fs-default {
            --feed-fs-2xl: 16px; /* large preview names, article title */
            --feed-fs-xl:  15px; /* news / video card headers */
            --feed-fs-lg:  14px; /* tweet/post body, author names, bios, captions */
            --feed-fs-md:  13px; /* quoted/context body, translations, chat, summaries */
            --feed-fs-sm:  12px; /* @handles, context author name, meta rows, card titles */
            --feed-fs-xs:  11px; /* action lines, context handle, poll labels, reactions */
            --feed-fs-2xs: 10px; /* follower pills, small headers, poll votes, badges */
            --feed-fs-3xs: 10px; /* micro badges / labels */
        }
        :root.fs-large { /* original sizing */
            --feed-fs-2xl: 17px;
            --feed-fs-xl:  16px;
            --feed-fs-lg:  15px;
            --feed-fs-md:  14px;
            --feed-fs-sm:  13px;
            --feed-fs-xs:  12px;
            --feed-fs-2xs: 11px;
            --feed-fs-3xs: 10px;
        }
        :root.fs-small { /* compact; floors keep micro-labels legible */
            --feed-fs-2xl: 15px;
            --feed-fs-xl:  14px;
            --feed-fs-lg:  13px;
            --feed-fs-md:  12px;
            --feed-fs-sm:  12px;
            --feed-fs-xs:  11px;
            --feed-fs-2xs: 10px;
            --feed-fs-3xs: 9px;
        }

        /* Unitless line-heights (ratios chosen to reproduce the original integer
           px spacing at the "large" preset, and track proportionally elsewhere). */
        .fs-2xl { font-size: var(--feed-fs-2xl); line-height: 1.412; }
        .fs-xl  { font-size: var(--feed-fs-xl);  line-height: 1.5; }
        .fs-lg  { font-size: var(--feed-fs-lg);  line-height: 1.467; }
        .fs-md  { font-size: var(--feed-fs-md);  line-height: 1.429; }
        .fs-sm  { font-size: var(--feed-fs-sm);  line-height: 1.538; }
        .fs-xs  { font-size: var(--feed-fs-xs);  line-height: 1; }
        .fs-2xs { font-size: var(--feed-fs-2xs); line-height: 1.091; }
        .fs-3xs { font-size: var(--feed-fs-3xs); line-height: 1; }

        /* Force integer line-heights for odd font sizes to prevent sub-pixel jitter.
           body line-height 1.5 produces fractional values for 11px (16.5) and 15px (22.5).
           (Legacy text-[Npx] rules retained for any non-migrated markup.) */
        .text-\[11px\] { line-height: 12px; }
        .text-\[10px\] { line-height: 10px; }
        .text-\[12px\] { line-height: 1; }

        /* Cover the 15px case used by follow cards, profile previews, etc. .tweet-body
           below already handles tweet text; this catches every other text-[15px] node
           inside the feed and keeps card heights at integer pixel multiples. */
        #feedContainer .text-\[15px\] { line-height: 22px; }

        /* Regular tweet body text */
        .tweet-body { font-size: var(--feed-fs-lg); line-height: 1.467; color: var(--theme-text-primary); }

        /* Nested reply/quote/retweet context body — hardcoded sweet spot between
           text-primary (#e4e4e7) and text-secondary: readable white, slightly dimmer than primary */
        .context-text,
        .context-text.context-text-muted { color: #c5c8cf; }

        /* Removed context container (deleted / unretweeted) — subtle red diagonal
           stripe applied across the ENTIRE context card, including any nested
           context tweets inside it. Layered behind the card's base background so
           content stays fully legible. */
        .context-removed {
            background-image: repeating-linear-gradient(
                -45deg,
                rgba(239, 68, 68, 0.16) 0,
                rgba(239, 68, 68, 0.16) 7px,
                rgba(239, 68, 68, 0.05) 7px,
                rgba(239, 68, 68, 0.05) 14px
            );
        }

        /* Tweet translation box — compact, self-contained (no Tailwind padding/utility
           classes). Sits under the source text it translates. */
        .tweet-translation {
            margin-top: 0.4rem;
            padding: 0.45rem 0.55rem;
            border: 1px solid rgba(59, 130, 246, 0.22);
            background: rgba(59, 130, 246, 0.07);
            border-radius: 3px;
        }
        .tweet-translation .translation-header {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            color: #60a5fa;
            font-size: var(--feed-fs-2xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            line-height: 1;
            margin-bottom: 0.4rem;
        }
        .tweet-translation .translation-header svg { flex-shrink: 0; opacity: 0.9; }
        .tweet-translation .translation-author {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            min-width: 0;
            margin-bottom: 0.3rem;
        }
        .tweet-translation .translation-avatar {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        .tweet-translation .translation-name {
            font-weight: 600;
            font-size: var(--feed-fs-sm);
            color: var(--theme-text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 160px;
        }
        .tweet-translation .translation-handle {
            font-size: var(--feed-fs-xs);
            color: var(--theme-text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .tweet-translation .translation-text {
            font-size: var(--feed-fs-md);
            line-height: 1.45;
            color: var(--theme-text-primary);
            word-break: break-word;
        }

        /* Context container text sizing - override Tailwind to use 13px (scoped + higher specificity than .text-xs) */
        #contentWrapper .text-xs {
            font-size: 13px;
            line-height: 20px;
        }

        .author-name-with-badges {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            max-width: 100%;
            min-width: 0;
            line-height: 1.3; /* tighter than body line-height to keep the single-line name row compact */
            vertical-align: text-bottom;
            color: var(--theme-text-primary);
        }

        .author-display-name {
            display: block; /* explicit so truncation never depends on the parent being a flex container */
            min-width: 0;
            max-width: 110px; /* width-based truncation cutoff */
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .author-badge-stack {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            flex-shrink: 0;
            line-height: 0;
        }

        /* Author meta row (handle, followers, separators): one size, one line-height,
           one muted color so every child aligns on the same center line. Chips inside
           (tag/deleted) keep their own colors but inherit the size. */
        .tweet-author-meta {
            font-size: var(--feed-fs-xs);
            line-height: 1.3;
            color: var(--theme-text-secondary);
        }

        .tweet-author-meta a {
            color: inherit;
        }

        .author-meta-dot {
            opacity: 0.6;
            user-select: none;
        }

        .author-verified-badge,
        .author-affiliate-badge {
            display: block;
            width: calc(1.0025em);
            height: calc(1.0025em);
            flex-shrink: 0;
        }

        .author-verified-badge {
            fill: #1d9bf0;
        }

        .author-government-verified-badge {
            fill: #829aab;
        }

        .author-affiliate-badge {
            object-fit: cover;
            background: rgba(255, 255, 255, 0.08);
        }

        .tweet-card-inner {
            padding: var(--tweet-card-pad);
            display: flex;
            flex-direction: column;
            gap: var(--tweet-card-gap);
        }
        /* Action header band (e.g. deleted) — bleed the gradient to the card edges
           like the follow/unfollow header, while keeping content position unchanged.
           Negative bottom margin absorbs the flex gap so the band fills down to the
           divider instead of stopping at the content. */
        .tweet-card-header-section--action {
            margin: calc(var(--tweet-card-pad) * -1) calc(var(--tweet-card-pad) * -1) calc(var(--tweet-card-gap) * -1);
            padding: var(--tweet-card-pad);
        }
        /* Event panel — body of the non-tweet Twitter event cards (account status,
           affiliation). Enough mass to be unmissable in a fast feed: 42px figure,
           verdict, one supporting detail. The accent lives on the left border so
           the variants only differ by colour. */
        .event-panel {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.85rem 0.75rem;
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-left: 3px solid currentColor;
        }
        /* Gone-for-good events reuse .context-removed's diagonal stripes */
        .event-panel--suspended {
            color: #F87171;
            background-color: rgba(239, 68, 68, 0.1);
            background-image: repeating-linear-gradient(
                -45deg,
                rgba(239, 68, 68, 0.12) 0,
                rgba(239, 68, 68, 0.12) 7px,
                rgba(239, 68, 68, 0.03) 7px,
                rgba(239, 68, 68, 0.03) 14px
            );
        }
        .event-panel--deactivated {
            color: #CBD5E1;
            background-color: rgba(148, 163, 184, 0.1);
            background-image: repeating-linear-gradient(
                -45deg,
                rgba(148, 163, 184, 0.12) 0,
                rgba(148, 163, 184, 0.12) 7px,
                rgba(148, 163, 184, 0.03) 7px,
                rgba(148, 163, 184, 0.03) 14px
            );
        }
        .event-panel--gained {
            color: #4ADE80;
            background-color: rgba(34, 197, 94, 0.1);
        }
        .event-panel--lost {
            color: #FB923C;
            background-color: rgba(251, 146, 60, 0.1);
        }
        .event-panel--switched {
            color: #60A5FA;
            background-color: rgba(96, 165, 250, 0.1);
        }
        .event-panel-figure {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            width: 42px;
            height: 42px;
            border-radius: 999px;
            overflow: hidden;
            box-shadow: 0 0 0 1px currentColor;
        }
        .event-panel-figure--icon {
            background: rgba(0, 0, 0, 0.28);
            box-shadow: none;
        }
        .event-panel-figure img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .event-panel-title {
            font-size: var(--feed-fs-xl);
            font-weight: 600;
            line-height: 1.25;
        }
        .event-panel-note {
            margin-top: 2px;
            font-size: var(--feed-fs-sm);
            line-height: 1.3;
            color: var(--theme-text-secondary);
        }
        .tweet-visibility-toggle .tweet-visibility-icon-closed {
            display: none;
        }
        .tweet-visibility-toggle[data-collapsed="true"] .tweet-visibility-icon-open {
            display: none;
        }
        .tweet-visibility-toggle[data-collapsed="true"] .tweet-visibility-icon-closed {
            display: block;
        }
        .tweet-card.tweet-card-collapsed > :not(.tweet-card-inner) {
            display: none !important;
        }
        .tweet-card.tweet-card-collapsed .tweet-card-inner {
            gap: 0;
        }
        .tweet-card-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.08);
            margin: -0.125rem 0;
            margin-left: calc(var(--tweet-card-pad) * -1);
            margin-right: calc(var(--tweet-card-pad) * -1);
            width: calc(100% + (var(--tweet-card-pad) * 2));
        }
        .tweet-card.tweet-card-collapsed .tweet-card-divider {
            display: none;
        }
        .tweet-card.tweet-card-collapsed .tweet-card-section:not(.tweet-card-header-section) {
            display: none;
        }

        .ultra-voice-alert-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.5rem var(--tweet-card-pad);
            background: linear-gradient(90deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.04));
            border-top: 1px solid rgba(239, 68, 68, 0.18);
            border-bottom: 1px solid rgba(239, 68, 68, 0.18);
        }
        .ultra-voice-alert-status {
            display: inline-flex;
            align-items: center;
            min-width: 0;
            gap: 0.5rem;
            color: rgb(252 165 165);
            font-size: var(--feed-fs-xs);
            font-weight: 600;
            letter-spacing: 0.01em;
        }
        .ultra-voice-alert-pulse {
            width: 0.45rem;
            height: 0.45rem;
            flex: 0 0 auto;
            border-radius: 999px;
            background: rgb(248 113 113);
            box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.55);
            animation: ultra-voice-alert-pulse 1.5s ease-out infinite;
        }
        .ultra-voice-acknowledge {
            flex: 0 0 auto;
            border: 1px solid rgba(248, 113, 113, 0.4);
            border-radius: 0.4rem;
            background: rgba(127, 29, 29, 0.34);
            color: rgb(254 202 202);
            padding: 0.3rem 0.55rem;
            font-size: var(--feed-fs-xs);
            font-weight: 650;
            line-height: 1.1;
            transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
        }
        .ultra-voice-acknowledge:hover,
        .ultra-voice-acknowledge:focus-visible {
            border-color: rgba(248, 113, 113, 0.75);
            background: rgba(153, 27, 27, 0.52);
            color: white;
            outline: none;
        }
        .tweet-card.tweet-card-collapsed .ultra-voice-alert-section {
            display: flex !important;
        }
        @keyframes ultra-voice-alert-pulse {
            70% {
                box-shadow: 0 0 0 0.38rem rgba(248, 113, 113, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
            }
        }
        @media (prefers-reduced-motion: reduce) {
            .ultra-voice-alert-pulse {
                animation: none;
            }
        }

        /* Thread affordance: compact in-feed pill, icon-first on narrower feeds. */
        .view-thread-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 24px;
            gap: 5px;
            padding: 0 7px;
            border: 1px solid color-mix(in srgb, var(--theme-accent) 35%, transparent);
            border-radius: 999px;
            background: color-mix(in srgb, var(--theme-accent) 9%, transparent);
            color: var(--theme-accent);
            font-size: var(--feed-fs-xs);
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
            transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
        }
        .view-thread-btn:hover {
            color: var(--theme-text-primary);
            border-color: color-mix(in srgb, var(--theme-accent) 60%, transparent);
            background: color-mix(in srgb, var(--theme-accent) 16%, transparent);
        }
        .view-thread-btn:focus-visible {
            outline: 2px solid var(--theme-accent);
            outline-offset: 2px;
        }
        .view-thread-btn.hidden {
            display: none;
        }
        .view-thread-count {
            display: inline-grid;
            place-items: center;
            min-width: 15px;
            height: 15px;
            padding: 0 3px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--theme-accent) 18%, transparent);
            font-size: var(--feed-fs-3xs);
            font-variant-numeric: tabular-nums;
        }

        /* Thread reader — a focused, feed-width reading surface with no duplicated card markup. */
        .thread-viewer-modal {
            position: fixed;
            inset: 0;
            /* Above app chrome, below child media/profile dialogs. */
            z-index: var(--z-thread-modal);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(2, 6, 12, 0.78);
            backdrop-filter: blur(8px);
            overflow: hidden;
            opacity: 0;
            transition: opacity 150ms ease;
        }
        .thread-viewer-modal.hidden {
            display: none;
        }
        .thread-viewer-modal.thread-viewer-open {
            opacity: 1;
        }
        .thread-viewer-panel {
            display: flex;
            flex-direction: column;
            width: min(760px, calc(100vw - 32px));
            max-height: calc(100vh - 32px);
            min-height: min(420px, calc(100vh - 32px));
            overflow: hidden;
            border: 1px solid var(--theme-border-primary);
            border-radius: 10px;
            background: var(--theme-bg-primary);
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.025);
            opacity: 0;
            transform: translateY(8px) scale(0.992);
            transition: opacity 150ms ease, transform 150ms ease;
        }
        .thread-viewer-open .thread-viewer-panel {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        .thread-viewer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
            min-height: 58px;
            padding: 10px 12px;
            border-bottom: 1px solid var(--theme-border-primary);
            background: color-mix(in srgb, var(--theme-bg-modal) 88%, transparent);
        }
        .thread-viewer-heading,
        .thread-viewer-header-actions {
            display: flex;
            align-items: center;
        }
        .thread-viewer-heading {
            min-width: 0;
            gap: 9px;
        }
        .thread-viewer-heading > div {
            min-width: 0;
        }
        .thread-viewer-icon {
            display: inline-grid;
            place-items: center;
            width: 31px;
            height: 31px;
            flex-shrink: 0;
            border: 1px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
            border-radius: 8px;
            background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
            color: var(--theme-accent);
        }
        #threadViewerTitle {
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-lg);
            font-weight: 650;
            line-height: 1.2;
            letter-spacing: 0.01em;
        }
        #threadViewerMeta {
            margin-top: 2px;
            max-width: min(60vw, 420px);
            overflow: hidden;
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-xs);
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .thread-viewer-header-actions {
            gap: 8px;
        }
        .thread-viewer-live {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .thread-viewer-live-dot {
            width: 6px;
            height: 6px;
            border-radius: 999px;
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
        }
        .thread-viewer-close {
            display: inline-grid;
            place-items: center;
            width: 31px;
            height: 31px;
            border: 1px solid transparent;
            border-radius: 7px;
            color: var(--theme-text-secondary);
            transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
        }
        .thread-viewer-close:hover {
            border-color: var(--theme-border-primary);
            background: var(--theme-bg-secondary);
            color: var(--theme-text-primary);
        }
        .thread-viewer-close:focus-visible {
            outline: 2px solid var(--theme-accent);
            outline-offset: 2px;
        }
        .thread-viewer-body {
            flex: 1;
            min-height: 0;
            min-width: 0;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-gutter: stable;
            padding: 10px;
            background:
                linear-gradient(180deg, color-mix(in srgb, var(--theme-bg-secondary) 28%, transparent), transparent 100px),
                var(--theme-bg-primary);
        }
        .thread-viewer-body .thread-viewer-card {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            margin-top: 0 !important;
            margin-bottom: 0 !important;
        }
        .thread-viewer-body .thread-viewer-card + .thread-viewer-card {
            margin-top: 10px !important;
        }

        @media (max-width: 900px) {
            .view-thread-btn {
                width: auto;
                min-width: 24px;
                padding: 0 5px;
            }
            .view-thread-label {
                display: none;
            }
        }
        @media (max-width: 640px) {
            .thread-viewer-modal {
                padding: 0;
            }
            .thread-viewer-panel {
                width: 100%;
                max-width: none;
                height: 100vh;
                height: 100dvh;
                max-height: 100vh;
                max-height: 100dvh;
                min-height: 100vh;
                min-height: 100dvh;
                border: 0;
                border-radius: 0;
            }
            .thread-viewer-header {
                padding-top: max(10px, env(safe-area-inset-top));
                padding-right: max(10px, env(safe-area-inset-right));
                padding-left: max(10px, env(safe-area-inset-left));
            }
            #threadViewerMeta {
                max-width: 62vw;
            }
            .thread-viewer-body {
                padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
            }
            .thread-viewer-live {
                font-size: 0;
                gap: 0;
            }
        }

        .tweet-card-section > .mt-4,
        .tweet-card-section > .mt-3,
        .tweet-card-section > .mt-2 {
            margin-top: 0 !important;
        }
        /* ── Grok conversation ──────────────────────────────────── */
        .tweet-grok {
            margin-top: 8px;
            width: 100%;
            max-width: 600px;
            overflow: hidden;
            border: 1px solid var(--theme-border-primary);
            border-radius: 10px;
            background: var(--theme-context-bg);
        }
        /* Main-tweet Grok lives in its own .tweet-card-section (gap handles spacing) */
        .tweet-card-section > .tweet-grok { margin-top: 0; }

        .grok-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 7px 10px;
            border-bottom: 1px solid var(--theme-border-primary);
        }
        .grok-title {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-width: 0;
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .grok-title svg {
            flex-shrink: 0;
            color: var(--theme-accent);
        }
        .grok-open {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
            color: var(--theme-accent);
            font-size: var(--feed-fs-xs);
            font-weight: 600;
            text-decoration: none;
            transition: opacity 120ms ease;
        }
        .grok-open:hover { opacity: 0.8; }

        .grok-body {
            display: flex;
            flex-direction: column;
            gap: 11px;
            padding: 10px;
        }
        .grok-turn {
            padding-left: 9px;
            border-left: 2px solid var(--theme-border-secondary);
        }
        .grok-turn--agent { border-left-color: var(--theme-accent); }
        .grok-turn-role {
            margin-bottom: 3px;
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .grok-turn--agent .grok-turn-role { color: var(--theme-accent); }
        .grok-turn-message {
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-sm);
            line-height: 1.5;
            word-break: break-word;
        }
        .grok-turn-media {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            margin-top: 7px;
        }
        .grok-turn-media img {
            display: block;
            width: 100%;
            height: 96px;
            object-fit: cover;
            border-radius: 8px;
            border: 1px solid var(--theme-border-primary);
        }
        .grok-turn-media img:only-child {
            grid-column: 1 / -1;
            height: auto;
            max-height: 180px;
        }
        .grok-more {
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
        }

        .tweet-link-card {
            display: flex;
            align-items: stretch;
            width: 100%;
            max-width: 600px;
            min-height: 72px;
            max-height: 96px;
            overflow: hidden;
            border: 1px solid var(--theme-border-primary);
            border-radius: 10px;
            background: var(--theme-context-bg);
            color: inherit;
            text-decoration: none;
            transition: border-color 120ms ease, background-color 120ms ease;
        }
        .tweet-link-card:hover {
            border-color: var(--theme-border-secondary);
            background: rgba(255, 255, 255, 0.035);
        }
        .tweet-link-card-thumb {
            position: relative;
            width: 108px;
            min-height: 72px;
            max-height: 96px;
            flex: 0 0 108px;
            overflow: hidden;
            background: var(--theme-poll-choice-media-bg);
            border-right: 1px solid var(--theme-border-primary);
        }
        .tweet-link-card-thumb-fallback {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--theme-text-muted);
            pointer-events: none;
        }
        .tweet-link-card-thumb-fallback::before {
            content: '';
            width: 28px;
            height: 28px;
            background: currentColor;
            opacity: 0.42;
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
        }
        .tweet-link-card-image {
            position: relative;
            z-index: 1;
            display: block;
            width: 100%;
            height: 100%;
            min-height: 72px;
            max-height: 96px;
            object-fit: cover;
        }
        .tweet-link-card-content {
            min-width: 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 0.18rem;
            padding: 0.55rem 0.7rem;
        }
        .tweet-link-card-domain {
            color: var(--theme-text-muted);
            font-size: var(--feed-fs-2xs);
            line-height: 1.1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .tweet-link-card-title {
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-sm);
            font-weight: 650;
            line-height: 1.2;
            display: -webkit-box;
            line-clamp: 2;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .tweet-link-card-description {
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-xs);
            line-height: 1.25;
            display: -webkit-box;
            line-clamp: 1;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
            opacity: 0.88;
        }
        .tweet-poll {
            display: flex;
            flex-direction: column;
            gap: 0.38rem;
        }
        .tweet-poll-choice {
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            background: var(--theme-poll-choice-bg);
            border: 1px solid rgba(255, 255, 255, 0.04);
        }
        .tweet-poll-choice-progress {
            position: absolute;
            inset: 0;
            background: rgba(255, 255, 255, 0.015);
        }
        .tweet-poll-choice-progress-fill {
            height: 100%;
            min-width: 0;
            background-color: var(--theme-accent);
            opacity: 0.22;
        }
        .tweet-poll-choice-content {
            position: relative;
            z-index: 1;
            display: flex;
            align-items: center;
            gap: 0.55rem;
            padding: 0.4rem 0.55rem;
            min-height: 2.7rem;
        }
        .tweet-poll-choice-media {
            width: 1.9rem;
            height: 1.9rem;
            flex-shrink: 0;
            border-radius: 0.55rem;
            overflow: hidden;
            background: var(--theme-poll-choice-media-bg);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
        .tweet-poll-choice-image {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }
        .tweet-poll-choice-media .image-placeholder {
            width: 100%;
            height: 100%;
            min-height: 100%;
            border-radius: inherit;
            border: 0;
        }
        .tweet-poll-choice-media .image-placeholder::before {
            width: 20px;
            height: 20px;
        }
        .tweet-poll-choice-media .image-placeholder::after {
            display: none;
        }
        .tweet-poll-choice-text {
            min-width: 0;
            flex: 1;
        }
        .tweet-poll-choice-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.6rem;
            min-width: 0;
        }
        .tweet-poll-choice-label-group {
            min-width: 0;
            display: flex;
            align-items: baseline;
            gap: 0.42rem;
        }
        .tweet-poll-choice-label {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-xs);
            line-height: 1.2;
            font-weight: 600;
        }
        .tweet-poll-choice-percentage {
            flex-shrink: 0;
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-xs);
            line-height: 1;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .tweet-poll-choice-votes {
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
            line-height: 1;
            white-space: nowrap;
            opacity: 0.82;
        }
        .tweet-poll-choice.is-leading {
            border-color: rgba(255, 255, 255, 0.08);
        }
        .tweet-poll-choice.is-leading .tweet-poll-choice-progress-fill {
            opacity: 0.32;
        }
        .tweet-poll-choice.is-leading .tweet-poll-choice-percentage,
        .tweet-poll-choice.is-leading .tweet-poll-choice-label {
            color: var(--theme-text-primary);
        }
        .tweet-poll-meta {
            padding-top: 0.12rem;
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-2xs);
            line-height: 1.2;
            letter-spacing: 0.01em;
            opacity: 0.86;
        }
        .truth-social-card .p-6 { padding: 0.75rem !important; }
        .truth-social-card .mb-4,
        .instagram-card .mb-4 { margin-bottom: 0.75rem !important; }
        .truth-social-card .pb-4,
        .instagram-card .pb-4 { padding-bottom: 0 !important; }

        /* Chat specific styles */
        .chat-card {
            background: var(--theme-bg-card);
            border: 1px solid var(--theme-border-primary);
            border-radius: 3px;
            margin-top: 0.75rem !important;
            margin-bottom: 0.75rem !important;
            contain: layout style;
            overflow: visible;
        }
        .chat-card .chat-body {
            font-size: var(--feed-fs-md);
            line-height: 22px;
            white-space: pre-wrap; /* Preserve newlines and wrap text */
            color: var(--theme-text-primary);
        }

        /* Chat card action buttons (react + translate) */
        .chat-card .chat-card-actions {
            opacity: 0;
            transition: opacity 0.15s ease;
        }
        .chat-card:hover .chat-card-actions {
            opacity: 1;
        }

        /* Chat reactions row */
        .chat-reactions {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 4px;
        }
        .chat-reactions:empty {
            display: none;
        }
        .chat-reaction-pill {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            padding: 1px 6px;
            font-size: var(--feed-fs-xs);
            line-height: 1.4;
            border-radius: 6px;
            background: var(--theme-bg-card);
            border: 1px solid var(--theme-border-primary);
            color: var(--theme-text-secondary, #a1a1aa);
            cursor: pointer;
            transition: border-color 0.15s ease, background 0.15s ease;
            user-select: none;
        }
        .chat-reaction-pill:hover {
            border-color: var(--theme-accent, #3b82f6);
            background: rgba(59, 130, 246, 0.08);
        }
        .chat-reaction-pill.active {
            border-color: var(--theme-accent, #3b82f6);
            background: rgba(59, 130, 246, 0.12);
            color: var(--theme-accent, #3b82f6);
        }

        /* Emoji picker popover */
        .chat-emoji-picker {
            display: flex;
            gap: 2px;
            padding: 4px 6px;
            background: var(--theme-bg-card, #18181b);
            border: 1px solid var(--theme-border-primary, #27272a);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            z-index: var(--z-local-popover);
            position: absolute;
            top: -36px;
            right: 0;
        }
        .chat-emoji-option {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            border-radius: 4px;
            border: none;
            background: transparent;
            cursor: pointer;
            transition: background 0.1s ease, transform 0.1s ease;
        }
        .chat-emoji-option:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: scale(1.2);
        }
        .chat-emoji-option.used {
            background: rgba(59, 130, 246, 0.15);
            border-radius: 4px;
            box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.4);
        }

        /* Truth Social card - clean, minimal patriotic accent.
           The top accent stripe is painted as part of the background (not a
           pseudo-element) so it shares the same rounded-corner clipping pass as the
           white body — no subpixel white slivers at the corner curves. */
        .truth-social-card {
            background:
                linear-gradient(90deg, #B31942 0%, #7a1f4d 50%, #0A3161 100%) top left / 100% 3px no-repeat,
                #ffffff;
            border-radius: 3px;
            position: relative;
            color: #1a202c !important;
            overflow: hidden;
            margin-top: 0.75rem !important;
            margin-bottom: 0.75rem !important;
            contain: layout style paint;
            isolation: isolate;
        }
        
        /* Truth Social specific text styling - white background needs dark text */
        .truth-social-card .text-white,
        .truth-social-card .text-gray-100,
        .truth-social-card .text-gray-200,
        .truth-social-card .text-gray-300,
        .truth-social-card .text-white\/95,
        .truth-social-card .text-white\/90,
        .truth-social-card .text-white\/80 {
            color: #111827 !important;
        }
        
        .truth-social-card .text-primary,
        .truth-social-card div .text-primary,
        .truth-social-card article .text-primary {
            color: #111827 !important;
        }
        
        .truth-social-card .text-gray-400,
        .truth-social-card .text-gray-500,
        .truth-social-card .text-muted,
        .truth-social-card div .text-muted,
        .truth-social-card article .text-muted {
            color: #6b7280 !important;
        }
        
        /* Truth Social links - lock to Twitter blue */
        .truth-social-card a {
            color: rgb(29, 155, 240) !important;
            transition: color 0.2s ease, opacity 0.15s ease;
        }

        .truth-social-card a:hover {
            color: rgb(29, 155, 240) !important;
            opacity: 0.82;
        }
        
        
        /* Truth Social timestamps and meta info */
        .truth-social-card .timestamp,
        .truth-social-card .text-sm {
            color: #6b7280 !important;
        }
        
        .truth-social-card article {
            position: relative;
            z-index: 1;
        }

        /* =====================================================================
           Trump AI Summary section (inside .truth-social-card)
           ===================================================================== */
        .truth-social-ai-section {
            margin: 0 16px 14px 16px;
            background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
            border: 1px solid rgba(10, 49, 97, 0.18);
            border-radius: 3px;
            padding: 12px 14px 12px 14px;
            color: #1a202c;
            position: relative;
            overflow: hidden;
            box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
        }
        .truth-social-ai-section::before {
            content: '';
            position: absolute;
            top: 0; left: 0; bottom: 0;
            width: 3px;
            background: linear-gradient(180deg, #B31942 0%, #0A3161 100%);
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
        }
        .truth-social-ai-section[data-ai-relevance="high"] {
            background: linear-gradient(180deg, #fff7e6 0%, #fff1d6 100%);
            border-color: rgba(217, 119, 6, 0.35);
        }
        .truth-social-ai-section[data-ai-relevance="urgent"] {
            background: linear-gradient(180deg, #ffefef 0%, #ffe1e1 100%);
            border-color: rgba(220, 38, 38, 0.45);
            animation: tsAiUrgentPulse 1.6s ease-in-out 0s 3;
        }
        .truth-social-ai-section[data-ai-relevance="watch"] {
            background: linear-gradient(180deg, #f3f8ff 0%, #e6f0ff 100%);
            border-color: rgba(37, 99, 235, 0.3);
        }
        .truth-social-ai-section[data-ai-relevance="low"] {
            opacity: 0.95;
        }
        .truth-social-ai-section[data-ai-relevance="error"] {
            background: #f8fafc;
            border-color: rgba(100, 116, 139, 0.3);
            opacity: 0.85;
        }
        @keyframes tsAiUrgentPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
            50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.18); }
        }

        .truth-social-ai-section .ts-ai-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: var(--feed-fs-xs);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: #0A3161 !important;
            margin-bottom: 8px;
        }
        .truth-social-ai-section .ts-ai-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 5px;
            background: linear-gradient(135deg, #0A3161 0%, #B31942 100%);
            color: #fff;
        }
        .truth-social-ai-section .ts-ai-title {
            color: #0A3161 !important;
        }
        .truth-social-ai-section .ts-ai-status {
            margin-left: auto;
            font-size: var(--feed-fs-3xs);
            font-weight: 600;
            letter-spacing: 0.4px;
            color: #6b7280 !important;
            text-transform: none;
        }
        .truth-social-ai-section .ts-ai-relevance {
            margin-left: auto;
            font-size: var(--feed-fs-3xs);
            font-weight: 800;
            letter-spacing: 0.6px;
            text-transform: uppercase;
            padding: 3px 8px;
            border-radius: 999px;
            color: #fff !important;
            background: #475569;
        }
        .truth-social-ai-section .ts-ai-rel-low     { background: #64748b; }
        .truth-social-ai-section .ts-ai-rel-watch   { background: #2563eb; }
        .truth-social-ai-section .ts-ai-rel-high    { background: #d97706; }
        .truth-social-ai-section .ts-ai-rel-urgent  { background: #dc2626; }

        .truth-social-ai-section .ts-ai-body {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .truth-social-ai-section .ts-ai-summary {
            font-size: var(--feed-fs-md);
            line-height: 1.45;
            font-weight: 600;
            color: #111827 !important;
        }
        .truth-social-ai-section .ts-ai-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .truth-social-ai-section .ts-ai-pill {
            display: inline-flex;
            align-items: center;
            font-size: var(--feed-fs-2xs);
            font-weight: 600;
            line-height: 1;
            padding: 4px 8px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.06);
            color: #1f2937 !important;
            border: 1px solid rgba(15, 23, 42, 0.08);
            text-transform: capitalize;
            letter-spacing: 0.2px;
        }
        .truth-social-ai-section .ts-ai-pill-cat       { background: rgba(10, 49, 97, 0.08); color: #0A3161 !important; border-color: rgba(10, 49, 97, 0.18); }
        .truth-social-ai-section .ts-ai-pill-conf      { background: rgba(15, 23, 42, 0.05); color: #374151 !important; }

        .truth-social-ai-section .ts-ai-error {
            font-size: var(--feed-fs-xs);
            color: #6b7280 !important;
            font-style: italic;
        }

        /* Skeleton + dots animation while AI is generating */
        .truth-social-ai-section .ts-ai-dots span {
            display: inline-block;
            opacity: 0.4;
            animation: tsAiDot 1.2s infinite ease-in-out;
        }
        .truth-social-ai-section .ts-ai-dots span:nth-child(2) { animation-delay: 0.15s; }
        .truth-social-ai-section .ts-ai-dots span:nth-child(3) { animation-delay: 0.3s; }
        @keyframes tsAiDot {
            0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
            40%           { opacity: 1;    transform: translateY(-1px); }
        }
        .truth-social-ai-section .ts-ai-skeleton {
            background: linear-gradient(90deg, rgba(15,23,42,0.06) 0%, rgba(15,23,42,0.12) 50%, rgba(15,23,42,0.06) 100%);
            background-size: 200% 100%;
            animation: tsAiShimmer 1.4s ease-in-out infinite;
            border-radius: 6px;
        }
        .truth-social-ai-section .ts-ai-skel-line {
            height: 12px;
            width: 100%;
        }
        .truth-social-ai-section .ts-ai-skel-line.short { width: 65%; }
        .truth-social-ai-section .ts-ai-skeleton-row {
            display: flex;
            gap: 6px;
            margin-top: 2px;
        }
        .truth-social-ai-section .ts-ai-skel-pill {
            height: 16px;
            width: 64px;
            border-radius: 999px;
        }
        @keyframes tsAiShimmer {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .truth-social-ai-section[data-ai-state="ready"] .ts-ai-dots,
        .truth-social-ai-section[data-ai-state="error"] .ts-ai-dots {
            display: none;
        }
        
        /* =====================================================================
           Instagram card — keeps tweet-card layout primitives, with stronger
           IG cues from the corner wash, avatar ring, and connected type mark.
           ===================================================================== */
        .instagram-card {
            --tweet-card-pad: 0.55rem;
            --tweet-card-gap: 0.55rem;
            --instagram-brand-gradient: linear-gradient(135deg, #dd2a7b 0%, #f58529 48%, #feda75 100%);
            background-color: var(--theme-bg-card) !important;
            background-image:
                radial-gradient(circle at top left, rgba(221, 42, 123, 0.24) 0%, rgba(221, 42, 123, 0.14) 26%, rgba(221, 42, 123, 0) 56%),
                radial-gradient(circle at bottom right, rgba(254, 218, 117, 0.22) 0%, rgba(245, 133, 41, 0.14) 30%, rgba(245, 133, 41, 0) 62%),
                linear-gradient(
                    to bottom right,
                    rgba(221, 42, 123, 0.08) 0%,
                    rgba(0, 0, 0, 0) 46%,
                    rgba(254, 218, 117, 0.08) 100%
            ) !important;
            border: 1px solid var(--theme-border-primary);
            border-radius: 3px;
            position: relative;
            overflow: hidden;
            box-shadow: none !important;
            margin-top: 0.75rem !important;
            margin-bottom: 0.75rem !important;
            contain: layout style paint;
        }

        .instagram-card article {
            position: relative;
            z-index: 1;
        }

        /* Avatar ring mirrors the card's IG pink-to-yellow direction. */
        .instagram-profile-pic-container {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2.25rem;
            height: 2.25rem;
            padding: 2px;
            border-radius: 999px;
            background: var(--instagram-brand-gradient);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(221, 42, 123, 0.18);
            box-sizing: border-box;
        }
        .instagram-profile-pic {
            border-radius: 50% !important;
            display: block;
            width: 100% !important;
            height: 100% !important;
            background: var(--theme-bg-card);
        }

        /* Connected icon + status chip, constrained to tweet-header row height. */
        .instagram-type-cluster {
            display: inline-flex;
            align-items: center;
            gap: 0;
            flex-shrink: 0;
            height: 20px;
            color: #f9a8d4;
            border: 1px solid rgba(221, 42, 123, 0.34);
            border-radius: 999px;
            background: rgba(221, 42, 123, 0.13);
            overflow: hidden;
            line-height: 1;
        }

        .instagram-glyph {
            width: 16px;
            height: 16px;
            color: #f472b6;
            flex-shrink: 0;
            margin: 0 5px 0 6px;
        }

        .instagram-type-badge {
            display: inline-flex;
            align-items: center;
            font-size: var(--feed-fs-3xs);
            font-weight: 600;
            line-height: 1;
            align-self: stretch;
            padding: 0 8px 0 7px;
            color: #f9a8d4;
            background: transparent;
            border-left: 1px solid rgba(221, 42, 123, 0.26);
            letter-spacing: 0.3px;
        }

        /* Compact "+X" badge on the last media tile. Keep it small so the
           picture remains visible while still signaling hidden/missing items. */
        .instagram-more-overlay {
            position: absolute;
            right: 8px;
            bottom: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            height: 28px;
            padding: 0 10px;
            background: rgba(0, 0, 0, 0.72);
            color: #fff;
            font-size: var(--feed-fs-sm);
            font-weight: 700;
            letter-spacing: -0.2px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 999px;
            pointer-events: none;
            z-index: 6;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        /* Header action icons — quiet at rest, IG-pink on hover. */
        .instagram-card .instagram-translate-btn,
        .instagram-card .instagram-action-link {
            color: #94a3b8;
            opacity: 0.7;
            transition: opacity 0.15s ease, color 0.15s ease;
            display: inline-flex;
            align-items: center;
        }
        .instagram-card .instagram-translate-btn:hover,
        .instagram-card .instagram-action-link:hover {
            opacity: 1;
            color: #dd2a7b;
        }

        /* Legacy class — hidden so any older payload paths don't render the old pill. */
        .instagram-tag { display: none !important; }

        /* Deprecated badge classes retained as harmless no-ops. */
        .instagram-badge { display: inline-flex; align-items: center; gap: 4px; background: transparent; padding: 0; box-shadow: none; border-radius: 0; font-size: inherit; font-weight: inherit; }
        .instagram-logo-badge { width: 14px; height: 14px; fill: currentColor; }

        /* News Card Styles */
        .news-card {
            background: #0a0a0f !important;
            border: 1px solid #1a1a23 !important;
            border-radius: 8px;
            position: relative;
            color: var(--theme-text-primary) !important;
            overflow: hidden;
            box-shadow: none !important;
            margin-top: 0.75rem !important;
            margin-bottom: 0.75rem !important;
            contain: layout style paint;
        }
        
        
        .news-card .text-primary,
        .news-card div .text-primary,
        .news-card article .text-primary {
            color: #e2e8f0 !important;
        }
        
        .news-card .text-secondary,
        .news-card div .text-secondary,
        .news-card article .text-secondary {
            color: #94a3b8 !important;
        }
        
        .news-card .text-muted,
        .news-card div .text-muted,
        .news-card article .text-muted {
            color: #64748b !important;
        }
        
        .news-card a {
            color: #64748b !important;
            text-decoration: none;
        }
        

        /* Media grid improvements */
        /* ============================================================
           MEDIA — tweets, context, Truth Social, Farcaster, Instagram.
           DOM: .tweet-media > .media-item > img.tweet-image | video.tweet-video
             • single → natural size, left-aligned, capped (no frame/bg)
             • grid   → clean edge-to-edge mosaic of equal-height tiles
           ============================================================ */
        .tweet-media { margin-top: 8px; }
        /* Main-tweet media lives in its own .tweet-card-section (gap handles spacing) */
        .tweet-card-section > .tweet-media { margin-top: 0; }

        .media-item { position: relative; }
        .media-item--video {
            isolation: isolate;
        }
        .media-item--video .tweet-video {
            position: relative;
            z-index: 1;
            pointer-events: auto;
        }

        /* Single item: sized by its natural aspect ratio, capped, left-aligned */
        .tweet-media--single { display: flex; }
        .tweet-media--single .media-item { display: inline-flex; max-width: 100%; }
        .tweet-media--single .tweet-image,
        .tweet-media--single .tweet-video {
            display: block;
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 320px;
            border-radius: 3px;
        }
        .tweet-media--single.tweet-media--context .tweet-image,
        .tweet-media--single.tweet-media--context .tweet-video {
            max-height: 250px;
        }

        /* Single video: force full card width (override natural left-aligned sizing).
           object-fit: contain keeps tall/portrait clips from stretching when the
           max-height cap kicks in. */
        .tweet-media--single-video { display: block; }
        .tweet-media--single-video .media-item { display: block; width: 100%; }
        .tweet-media--single-video .tweet-video {
            width: 100%;
            max-width: 100%;
            object-fit: contain;
        }

        /* Multiple items: mosaic grid with equal-height cover tiles */
        .tweet-media--grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 3px;
            width: 100%;
            max-width: 600px;
            border-radius: 3px;
            overflow: hidden;
        }
        .tweet-media--grid.tweet-media--context { max-width: 500px; }
        .tweet-media--grid .media-item.span-2 { grid-column: 1 / -1; }
        .tweet-media--grid .tweet-image,
        .tweet-media--grid .tweet-video {
            display: block;
            width: 100%;
            height: 100%;
            aspect-ratio: 16 / 10;
            object-fit: cover;
            background: rgba(0, 0, 0, 0.2);
        }
        .tweet-media--grid .media-item.span-2 .tweet-image,
        .tweet-media--grid .media-item.span-2 .tweet-video {
            aspect-ratio: 16 / 9;
        }

        /* Native fullscreen should use the video's real aspect ratio, not the
           grid tile crop used for mosaic layout. */
        video.tweet-video:fullscreen,
        video.tweet-video:-webkit-full-screen {
            aspect-ratio: auto;
            width: 100%;
            height: 100%;
            max-width: none;
            max-height: none;
            object-fit: contain;
            background: #000;
        }

        /* Hover tools (reverse image search + OCR) over an image tile */
        .media-tool {
            position: absolute;
            top: 8px;
            z-index: 10;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 5px;
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            opacity: 0;
            transition: opacity 150ms ease, background-color 150ms ease;
        }
        .media-tool-search { left: 8px; }
        .media-tool-ocr { right: 8px; }
        .media-item:hover .media-tool { opacity: 1; }
        .media-tool:hover { background: rgba(0, 0, 0, 0.9); }

        .tweet-video-speed-button {
            position: absolute;
            right: 10px;
            top: 10px;
            z-index: 2;
            min-width: 46px;
            height: 30px;
            padding: 0 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 999px;
            background: rgba(0, 0, 0, 0.72);
            color: #fff;
            font-size: var(--feed-fs-sm);
            font-weight: 700;
            line-height: 1;
            letter-spacing: 0.01em;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
        }

        .media-item:hover .tweet-video-speed-button,
        .media-item:focus-within .tweet-video-speed-button {
            opacity: 0.86;
            pointer-events: auto;
        }

        .tweet-video-speed-button:hover,
        .tweet-video-speed-button:focus-visible {
            opacity: 1;
            background: rgba(0, 0, 0, 0.9);
            border-color: rgba(255, 255, 255, 0.35);
            outline: none;
        }
        
        /* Tweet URL styles */
        .tweet-url {
            color: #60a5fa;
            text-decoration: none;
            font-weight: 500;
            font-size: var(--feed-fs-md);
            display: inline-block;
            padding: 4px 8px;
            background: rgba(96, 165, 250, 0.1);
            border-radius: 6px;
            border: 1px solid rgba(96, 165, 250, 0.2);
            transition: all 0.2s ease;
            margin: 2px 0;
        }
        
        .tweet-url:hover {
            color: #93c5fd;
            background: rgba(96, 165, 250, 0.2);
            border-color: rgba(96, 165, 250, 0.4);
            text-decoration: none;
        }
        
        /* Responsive media adjustments */
        @media (max-width: 640px) {
            .tweet-media--single .tweet-image,
            .tweet-media--single .tweet-video {
                max-height: 280px;
            }

            .tweet-media--single.tweet-media--context .tweet-image,
            .tweet-media--single.tweet-media--context .tweet-video {
                max-height: 200px;
            }
        }
        
        /* Status indicators */
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
        }
        
        .status-connected { background: #10b981; }
        .status-connecting { background: #f59e0b; }
        .status-error { background: #ef4444; }
        
        /* Typography improvements — single source of truth: theme tokens.
           Both the .text-* utility classes and var(--theme-text-*) now resolve to
           the same theme-aware values, so tweets and follow/other cards match. */
        .text-primary { color: var(--theme-text-primary); }
        .text-secondary { color: var(--theme-text-secondary); }
        .text-muted { color: var(--theme-text-muted); }
        .text-accent { color: var(--theme-accent); }
        .tweet-inline-link {
            color: #60a1f0 !important;
            transition: opacity 0.15s ease;
        }
        .tweet-inline-link:hover {
            color: #3c88e6 !important;
            opacity: 0.82;
        }
        
        /* Improved form controls */
        .form-control {
            background: #0f172a;
            border: 1px solid #334155;
            border-radius: 8px;
            color: #f1f5f9;
            font-size: 14px;
            padding: 8px 12px;
            transition: border-color 0.15s ease;
        }
        
        .form-control:focus {
            outline: none;
            border-color: var(--theme-accent);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.20);
        }

        .settings-radio-option {
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.65rem 0.75rem;
            border: 1px solid var(--theme-border-secondary);
            border-radius: 0.65rem;
            background: rgba(255, 255, 255, 0.014);
            color: var(--theme-text-secondary);
            cursor: pointer;
            transition: background-color 80ms ease, border-color 80ms ease, color 80ms ease, transform 80ms ease;
        }

        .settings-radio-option:hover {
            border-color: rgba(165, 180, 252, 0.28);
            background: rgba(255, 255, 255, 0.045);
            color: var(--theme-text-primary);
        }

        .settings-radio-option:active {
            transform: translateY(1px);
        }

        .settings-radio-option:focus-within {
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
        }

        .settings-radio-option input[type="radio"] {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .settings-radio-option:has(input[type="radio"]:checked) {
            border-color: rgba(99, 102, 241, 0.36);
            background: rgba(99, 102, 241, 0.14);
            color: var(--theme-text-primary);
        }

        .settings-radio-indicator {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1rem;
            height: 1rem;
            border: 1px solid rgba(148, 163, 184, 0.45);
            border-radius: 9999px;
            flex: 0 0 auto;
            transition: border-color 80ms ease, background-color 80ms ease, box-shadow 80ms ease;
        }

        .settings-radio-option:has(input[type="radio"]:checked) .settings-radio-indicator {
            border-color: var(--theme-accent);
            background: var(--theme-accent);
            box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.92);
        }

        .settings-radio-option-compact {
            justify-content: center;
            min-height: 2rem;
            padding: 0.45rem 0.65rem;
            font-size: 0.8125rem;
        }
        
        /* Accent utilities (Tailwind-like aliases mapped to theme variables) */
        .bg-accent-500 { background-color: var(--theme-accent) !important; }
        .hover\:bg-accent-600:hover { background-color: var(--theme-accent-hover) !important; }
        .text-accent-300 { color: var(--theme-accent) !important; opacity: .85; }
        .focus\:ring-accent-500:focus { box-shadow: 0 0 0 2px var(--theme-accent) !important; }
        .focus\:ring-accent-500\/50:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.35) !important; }
        .hover\:bg-accent-500\/10:hover { background-color: rgba(99,102,241,.10) !important; }
        .border-accent-500\/40 { border-color: rgba(99,102,241,.40) !important; }

        /* Settings sidebar responsive collapse on narrow viewports */
        #settingsSidebar { width: 12rem; transition: width .2s ease; }
        #settingsSidebar .nav-button { display: flex; align-items: center; gap: .5rem; }
        #settingsSidebar .tab-label { display: inline; }
        @media (max-width: 900px) {
            #settingsSidebar { width: 3.5rem; padding-left: .5rem; padding-right: .5rem; }
            #settingsSidebar .tab-label { display: none; }
            #settingsSidebar .nav-button { justify-content: center; }
        }
        
        /* Header glass effect - cleaner, more subtle */
        .glass-header {
            backdrop-filter: blur(16px) saturate(150%);
            background: var(--theme-glass-header-bg);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            position: relative;
        }
        
        /* Smooth transitions for header logo/pause icon swap */
        #headerLogo, #headerPauseIcon {
            transition: opacity 0.08s ease;
        }
        
        /* Subtle top accent line for depth */
        .glass-header::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 50%, transparent);
            opacity: 0.5;
        }

        /* Active Users Popup - minimalistic footer aesthetic */
        #usersTooltip > div:first-child {
            background: var(--theme-tooltip-bg);
        }
        #usersTooltip .absolute {
            background: var(--theme-tooltip-bg);
        }
        /* Minimal scrollbar for users list */
        #usersList::-webkit-scrollbar {
            width: 4px;
        }
        #usersList::-webkit-scrollbar-track {
            background: transparent;
        }
        #usersList::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
        }
        #usersList::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.15);
        }
        #usersList {
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
        }

        /* Floating "New Tweets" button */
        #newTweetsButton {
            position: fixed;
            /* Clear the 52px app header while staying below its stacking layer. */
            top: 3.75rem;
            left: 50%;
            transform: translateX(-50%);
            /* Above feed cards, below settings, chrome, and every dialog. */
            z-index: var(--z-feed-floating);
            display: none;
            background: rgba(17, 17, 17, 0.5);
            color: var(--theme-text-primary);
            border: 1px solid var(--theme-border-secondary);
            border-radius: 9999px;
            padding: 0.25rem 0.6rem; /* py-1 px-2.5 approximate */
            box-shadow: 0 10px 25px rgba(0,0,0,0.35);
            backdrop-filter: blur(8px);
        }
        #newTweetsButton:hover { background: rgba(24, 24, 27, 0.65); }
        #newTweetsButton .icon { width: 16px; height: 16px; margin-right: 6px; }
        #newTweetsButton .label { font-size: 12px; font-weight: 600; }
        
        /* Audio Warning Banner */
        .audio-warning-banner {
            background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
            border-bottom: 1px solid rgba(217, 119, 6, 0.2);
            backdrop-filter: blur(8px);
            position: relative;
            z-index: var(--z-banner);
            animation: slideDown 0.3s ease-out;
        }
        
        .audio-warning-banner.hidden {
            display: none;
        }
        
        /* Subscription Warning Banner */
        .subscription-warning-banner {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.08) 100%);
            border-bottom: 1px solid rgba(239, 68, 68, 0.2);
            backdrop-filter: blur(8px);
            position: relative;
            z-index: var(--z-banner);
            animation: slideDown 0.3s ease-out;
        }
        
        .subscription-warning-banner.hidden {
            display: none;
        }
        
        @keyframes slideDown {
            from {
                transform: translateY(-100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        /* Chat input subtle interactions */
        #chatInput {
            transition: all 150ms ease;
        }
        
        #chatInput:focus {
            color: var(--theme-text-primary);
        }
        
        #chatInput::placeholder {
            color: var(--theme-text-muted);
            opacity: 0.6;
        }
        
        #chatInput:focus::placeholder {
            opacity: 0.4;
        }
        
        /* Chat container focus state */
        #chatInputContainer {
            transition: border-color 200ms ease;
        }
        
        #chatInputContainer:has(#chatInput:focus) {
            border-top-color: rgba(255, 255, 255, 0.1);
        }
        
        #chatInputContainer:has(#chatInput:focus) .chat-prompt {
            opacity: 1;
        }
        
        /* Color picker improvements */
        .color-picker-container {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .color-picker {
            width: 32px;
            height: 32px;
            border: 2px solid #334155;
            border-radius: 8px;
            background: transparent;
            cursor: pointer;
            padding: 0;
            outline: none;
        }
        
        .color-picker::-webkit-color-swatch-wrapper {
            padding: 0;
            border: none;
            border-radius: 6px;
        }
        
        .color-picker::-webkit-color-swatch {
            border: none;
            border-radius: 6px;
        }
        
        .color-picker::-moz-color-swatch {
            border: none;
            border-radius: 6px;
        }

        /* Highlight color swatch button */
        .highlight-color-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px 4px 5px;
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.08);
            background: var(--theme-bg-tertiary, #1a1a2e);
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .highlight-color-btn:hover {
            background: var(--theme-bg-secondary, #222);
            border-color: rgba(255,255,255,0.15);
        }
        .highlight-color-swatch {
            display: block;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.12);
            flex-shrink: 0;
            box-shadow: 0 0 6px rgba(0,0,0,0.3);
        }
        .highlight-color-chevron {
            color: var(--theme-text-secondary, #888);
            transition: transform 0.15s;
            flex-shrink: 0;
        }
        .highlight-color-btn.open .highlight-color-chevron {
            transform: rotate(180deg);
        }

        /* Color picker popup */
        .highlight-color-popup {
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            z-index: var(--z-modal-popover);
            background: var(--theme-bg-primary, #111);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 10px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5);
            min-width: 170px;
            animation: hlPopupIn 0.12s ease-out;
        }
        .highlight-color-popup.hidden {
            display: none;
        }
        @keyframes hlPopupIn {
            from { opacity: 0; transform: translateY(-4px) scale(0.97); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* Preset color grid */
        .highlight-color-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }
        .highlight-preset {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            border: none;
            background: none;
            cursor: pointer;
            border-radius: 8px;
            transition: transform 0.1s, box-shadow 0.1s;
        }
        .highlight-preset span {
            display: block;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 2.5px solid transparent;
            transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
        }
        .highlight-preset:hover span {
            transform: scale(1.15);
            box-shadow: 0 0 8px rgba(255,255,255,0.15);
        }
        .highlight-preset.selected span {
            border-color: #fff;
            box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
        }

        /* Divider */
        .highlight-color-divider {
            height: 1px;
            background: rgba(255,255,255,0.07);
            margin: 8px 0;
        }

        /* Custom color button */
        .highlight-custom-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 6px 0;
            border: 1px dashed rgba(255,255,255,0.12);
            border-radius: 6px;
            background: none;
            color: var(--theme-text-secondary, #999);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .highlight-custom-btn:hover {
            background: rgba(255,255,255,0.04);
            color: var(--theme-text-primary, #eee);
            border-color: rgba(255,255,255,0.2);
        }

        .kw-color-wrapper .highlight-color-popup {
            position: fixed;
            top: auto;
            right: auto;
            left: auto;
            z-index: var(--z-modal-popover);
            min-width: 170px;
        }
        
        .color-reset {
            width: 2rem;
            height: 2rem;
            border: 1px solid var(--theme-border-primary);
            border-radius: 0.45rem;
            background: rgba(255, 255, 255, 0.035);
            color: var(--theme-text-muted);
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 80ms ease, border-color 80ms ease, color 80ms ease, transform 80ms ease;
        }
        
        .color-reset:hover {
            border-color: rgba(165, 180, 252, 0.35);
            background: rgba(255, 255, 255, 0.065);
            color: var(--theme-text-primary);
        }

        .color-reset:focus-visible {
            outline: 2px solid rgba(165, 180, 252, 0.65);
            outline-offset: 2px;
        }

        .color-reset:active {
            transform: translateY(1px);
        }


        /* CA Action Buttons */
        .ca-actions-container {
            margin-top: 16px;
            padding: 16px;
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
            border: 1px solid rgba(139, 92, 246, 0.2);
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }
        
        .ca-actions-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-size: var(--feed-fs-md);
            font-weight: 600;
            color: #a78bfa;
        }
        
        .ca-actions-buttons {
            display: flex;
            gap: 8px;
            width: 100%;
            padding-top: 10px;
        }
        
        .ca-action-btn {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: var(--feed-fs-md);
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            color: white;
            min-height: 44px;
        }
        
        .ca-action-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }
        
        .ca-action-btn:active {
            transform: translateY(0);
        }
        
        .ca-action-btn.open-browser {
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            border: 1px solid rgba(59, 130, 246, 0.3);
        }
        
        .ca-action-btn.open-browser:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        }
        
        .ca-action-btn.copy-ca {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            border: 1px solid rgba(5, 150, 105, 0.3);
        }
        
        .ca-action-btn.copy-ca:hover {
            background: linear-gradient(135deg, #047857 0%, #065f46 100%);
        }
        
        .ca-action-btn.copy-ca.copied {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            border: 1px solid rgba(220, 38, 38, 0.3);
        }
        
        .ca-address {
            font-family: inherit;
            font-size: var(--feed-fs-md);
            color: #cbd5e1;
            background: rgba(0, 0, 0, 0.3);
            padding: 6px 8px;
            border-radius: 6px;
            word-break: break-all;
            line-height: 1.3;
        }

        /* Fallback styles */
        .tailwind-fallback * {
            font-family: var(--theme-font-ui) !important;
        }
        
        .tailwind-fallback .bg-dark-900 { background-color: #0f172a !important; }
        .tailwind-fallback .text-primary { color: var(--theme-text-primary) !important; }
        .tailwind-fallback .text-secondary { color: var(--theme-text-secondary) !important; }
        .tailwind-fallback .text-muted { color: var(--theme-text-muted) !important; }

        /* Simple CA UI */
        .ca-simple {
            margin-top: 12px;
            margin-bottom: 10px;
            display: flex;
            align-items: stretch;
            gap: 0;
            background: rgba(39, 39, 42, 0.8);
            border: 1px solid rgba(253, 224, 71, 0.8);
            border-radius: 10px;
            overflow: hidden;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(253, 224, 71, 0.15);
        }

        .ca-simple.solana {
            border: 1px solid transparent;
            background: rgba(39, 39, 42, 0.8);
            background-image: linear-gradient(rgba(39, 39, 42, 0.8), rgba(39, 39, 42, 0.8)), linear-gradient(135deg, #00FFA3 0%, #DC1FFF 100%);
            background-origin: border-box;
            background-clip: padding-box, border-box;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(0, 255, 163, 0.15);
        }

        .ca-simple.evm {
            border: 1px solid rgba(253, 224, 71, 0.8);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(253, 224, 71, 0.15);
        }

        .ca-simple.base {
            border: 1px solid rgba(0, 82, 255, 0.8);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(0, 82, 255, 0.15);
        }

        .ca-simple.eth {
            border: 1px solid rgba(98, 126, 234, 0.8);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(98, 126, 234, 0.15);
        }

        .ca-simple.rh {
            border: 1px solid rgba(204, 255, 0, 0.8);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(204, 255, 0, 0.15);
        }

        .ca-hover-copy {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: transparent;
            border: 0;
            cursor: pointer;
            text-align: left;
            color: #e5e7eb;
            font-family: inherit;
            font-size: var(--feed-fs-lg);
            line-height: 1.2;
        }

        .ca-hover-copy:hover {
            background: rgba(39, 39, 42, 0.5);
        }

        .ca-hover-copy .ca-label {
            font-weight: 600;
            color: #fde047;
        }

        .ca-chain-icon {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }

        .ca-hover-copy .ca-text {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .ca-chain-verified {
            display: flex;
            align-items: center;
            justify-content: center;
            align-self: stretch;
            width: 34px;
            color: #22c55e;
            background: rgba(34, 197, 94, 0.08);
            border-left: 1px solid rgba(34, 197, 94, 0.2);
        }

        .ca-chain-verified.hidden {
            display: none;
        }

        .keyword-highlight {
            border-radius: 3px;
        }

        .inline-ca-copy {
            cursor: copy;
            transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
            user-select: none;
        }

        .inline-ca-copy:hover {
            filter: brightness(1.15);
            box-shadow: 0 0 0 1px currentColor;
        }

        .inline-ca-copy:focus-visible {
            outline: 2px solid currentColor;
            outline-offset: 2px;
        }

        .ca-divider {
            display: none;
        }

        .ca-platform-link {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 12px;
            background: transparent;
            border: 0;
            border-left: 1px solid rgba(71, 85, 105, 0.4);
            color: #cbd5e1;
            text-decoration: none;
            cursor: pointer;
        }

        .ca-platform-link:hover {
            background: rgba(39, 39, 42, 0.5);
        }

        .ca-platform-link img {
            width: 20px;
            height: 20px;
            border-radius: 4px;
        }

        /* Follower enhancement CA preview — reuse ca-simple, tighten spacing */
        .following-enhancement-ca .ca-simple {
            margin-top: 0;
            margin-bottom: 0;
            flex: 1 1 auto;
            min-width: 0;
            max-width: 100%;
        }

        /* Token suggestion UI */
        .token-suggestion-bar {
            margin: 1px 0 4px;
            padding: 4px 5px 5px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
            min-width: 0;
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.02);
        }

        .token-suggestion-label {
            flex: 0 0 auto;
            align-self: flex-start;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 0 2px 3px;
            color: var(--theme-text-muted);
            font-size: var(--feed-fs-3xs);
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            opacity: 0.6;
            user-select: none;
        }

        .token-suggestion-label svg {
            display: block;
            opacity: 0.85;
        }

        .token-suggestion-divider {
            height: 1px;
            margin: 0 -5px;
            background: rgba(255, 255, 255, 0.07);
        }

        .token-suggestion-list {
            flex: 1 1 auto;
            display: flex;
            align-items: stretch;
            gap: 4px;
            min-width: 0;
            padding-top: 4px;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
        }

        .token-suggestion-card {
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
            max-width: 220px;
            padding: 3px 9px 3px 3px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.035);
            color: inherit;
            text-decoration: none;
            transition: background-color 120ms ease, border-color 120ms ease;
        }

        .token-suggestion-card:hover {
            background: rgba(255, 255, 255, 0.07);
            border-color: rgba(134, 239, 172, 0.35);
        }

        .token-suggestion-avatar-wrap {
            position: relative;
            flex: 0 0 auto;
            width: 28px;
            height: 28px;
        }

        .token-suggestion-avatar {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 4px;
            object-fit: cover;
            background: rgba(255, 255, 255, 0.06);
            color: #e5e7eb;
            font-size: 13px;
            font-weight: 800;
        }

        .token-suggestion-launchpad-dot {
            position: absolute;
            right: -3px;
            bottom: -3px;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 15px;
            width: 15px;
            height: 15px;
            padding-inline: 2px;
            border: 1px solid transparent;
            border-radius: 999px;
            background:
                linear-gradient(var(--theme-bg-card), var(--theme-bg-card)) padding-box,
                linear-gradient(180deg, #E5C20F 14.9%, #C68300 100%) border-box;
            color: #facc15;
            font-size: 9px;
            font-weight: 900;
            line-height: 1;
            box-sizing: border-box;
        }

        .token-suggestion-launchpad-dot img {
            display: block;
            width: 10px;
            height: 10px;
            object-fit: contain;
        }

        .token-suggestion-copy {
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 2px;
        }

        .token-suggestion-line {
            display: flex;
            align-items: baseline;
            gap: 5px;
            min-width: 0;
        }

        .token-suggestion-symbol {
            flex: 0 1 auto;
            min-width: 0;
            max-width: 90px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #f8fafc;
            font-size: var(--feed-fs-xs);
            font-weight: 800;
            line-height: 1.1;
        }

        .token-suggestion-name {
            flex: 0 1 auto;
            min-width: 0;
            max-width: 100px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--theme-text-muted);
            font-size: var(--feed-fs-2xs);
            font-weight: 500;
            line-height: 1.1;
        }

        .token-suggestion-mcap {
            color: rgba(134, 239, 172, 0.9);
            font-size: var(--feed-fs-3xs);
            font-weight: 700;
            line-height: 1;
            white-space: nowrap;
        }


        /* Profile Change Text Container */
        .profile-change-text {
            line-height: 1.8;
        }

        /* Profile Change Text Bubbles */
        .profile-change-added {
            display: inline;
            background: rgba(34, 197, 94, 0.15);
            border: 1px solid rgba(34, 197, 94, 0.3);
            padding: 1px 5px;
            border-radius: 4px;
            color: #4ade80 !important;
            font-weight: 500;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }
        
        .profile-change-removed {
            display: inline;
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            padding: 1px 5px;
            border-radius: 4px;
            color: #f87171 !important;
            font-weight: 500;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }
        
        /* Profile Change Image Borders */
        .profile-image-added {
            border: 3px solid rgba(34, 197, 94, 0.7);
            box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
        }
        
        .profile-image-removed {
            border: 3px solid rgba(239, 68, 68, 0.7);
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
            opacity: 0.85;
        }

        /* Image Placeholder Styles */
        .image-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            background:
                linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent),
                var(--theme-bg-secondary);
            border: 1px solid var(--theme-border-primary);
            border-radius: 8px;
            min-height: 150px;
            width: 100%;
            position: relative;
            overflow: hidden;
            color: var(--theme-text-muted);
        }

        .image-placeholder::before {
            content: '';
            position: absolute;
            top: calc(50% - 10px);
            left: 50%;
            transform: translate(-50%, -50%);
            width: 34px;
            height: 34px;
            background: currentColor;
            opacity: 0.46;
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4' width='17' height='16' rx='3'/%3E%3Ccircle cx='8.5' cy='9' r='1.5'/%3E%3Cpath d='m5 18 5.5-5.5 4 4 2-2L20 18'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4' width='17' height='16' rx='3'/%3E%3Ccircle cx='8.5' cy='9' r='1.5'/%3E%3Cpath d='m5 18 5.5-5.5 4 4 2-2L20 18'/%3E%3C/svg%3E") center / contain no-repeat;
        }

        .image-placeholder::after {
            content: 'Media unavailable';
            position: absolute;
            top: calc(50% + 18px);
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: var(--feed-fs-2xs);
            font-weight: 500;
            letter-spacing: 0.01em;
            color: var(--theme-text-muted);
            text-align: center;
            white-space: nowrap;
            opacity: 0.78;
        }

        /* Hide the actual broken image when it fails */
        img.image-failed {
            display: none !important;
        }

        /* Ensure placeholder maintains proper aspect ratio in media grids */
        .media-item .image-placeholder {
            min-height: 150px;
            max-height: 400px;
        }

        .tweet-media--context .media-item .image-placeholder {
            min-height: 120px;
            max-height: 300px;
        }

        /* Chat media placeholder */
        .chat-media.image-failed + .image-placeholder {
            max-width: 384px;
            max-height: 256px;
        }

        /* Chat-only mode (H key held) - hide all non-chat items */
        .chat-only-mode > *:not(.chat-card) {
            display: none !important;
        }

        /* Smart follower hover card: instant show/hide (no theme transition bleed) */
        #smart-follower-hover-tooltip {
            transition: none !important;
            animation: none !important;
        }

        /* ============================================================
           Toast notifications (top-right, reusable)
           ============================================================ */
        .toast-container {
            position: fixed;
            top: 16px;
            right: 16px;
            z-index: var(--z-toast);
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 8px;
            pointer-events: none;
            max-width: min(360px, calc(100vw - 32px));
        }

        .toast {
            pointer-events: auto;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            max-width: 100%;
            padding: 9px 13px;
            border-radius: 10px;
            background: var(--theme-bg-card, #18181b);
            border: 1px solid var(--theme-border-primary, #27272a);
            color: var(--theme-text-primary, #e5e7eb);
            font-size: var(--feed-fs-sm, 13px);
            font-weight: 500;
            line-height: 1.35;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
            cursor: pointer;
            opacity: 0;
            transform: translateX(12px);
            transition: opacity 0.18s ease, transform 0.18s ease;
            will-change: opacity, transform;
        }

        .toast.toast-visible {
            opacity: 1;
            transform: translateX(0);
        }

        .toast-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .toast-message {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .toast-success .toast-icon { color: #22c55e; }
        .toast-error .toast-icon { color: #ef4444; }
        .toast-info .toast-icon { color: var(--theme-accent, #60a5fa); }

        @media (prefers-reduced-motion: reduce) {
            .toast {
                transition: opacity 0.12s ease;
                transform: none;
            }
            .toast.toast-visible { transform: none; }
            .thread-viewer-modal,
            .thread-viewer-panel,
            .view-thread-btn {
                transition: none;
            }
            .thread-viewer-panel {
                transform: none;
            }
        }

        /* Fomo Family cards use a midnight-market surface rather than a colored
           border, keeping them distinct from tweets without breaking the feed rhythm. */
        .fomo-thesis-card {
            --fomo-accent: #a8b4ff;
            --fomo-brand-gradient: linear-gradient(135deg, #a8b4ff 0%, #8276ff 46%, #46d4d2 100%);
            position: relative;
            overflow: hidden;
            border: 1px solid var(--theme-border-primary) !important;
            background-color: var(--theme-bg-card) !important;
            background-image:
                radial-gradient(circle at 102% -14%, rgba(130, 118, 255, 0.28) 0%, rgba(130, 118, 255, 0.13) 30%, transparent 62%),
                radial-gradient(circle at -8% 112%, rgba(70, 212, 210, 0.17) 0%, transparent 52%),
                linear-gradient(135deg, rgba(168, 180, 255, 0.08) 0%, transparent 43%, rgba(70, 212, 210, 0.055) 100%) !important;
            box-shadow: inset 0 1px 0 rgba(220, 224, 255, 0.05) !important;
            contain: layout style paint;
        }

        .fomo-thesis-header {
            padding-right: 3.75rem;
        }

        .fomo-author-avatar,
        .fomo-token-image {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            color: #eef0ff;
            background:
                linear-gradient(rgba(22, 27, 58, 0.94), rgba(22, 27, 58, 0.94)) padding-box,
                var(--fomo-brand-gradient) border-box;
            border: 1px solid transparent;
            font-weight: 700;
        }

        .fomo-author-avatar {
            width: 2.25rem;
            height: 2.25rem;
            border-radius: 50%;
            font-size: var(--feed-fs-md);
        }

        .fomo-author-avatar img,
        .fomo-token-image img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .fomo-thesis-badge {
            display: inline-flex;
            align-items: center;
            flex: 0 0 auto;
            padding: 1px 0.3rem;
            color: #c4ceff;
            background: rgba(130, 118, 255, 0.16);
            border-radius: 3px;
            font-size: var(--feed-fs-2xs);
            font-weight: 750;
            line-height: 1.2;
        }

        .fomo-author-handle:hover,
        .fomo-token-main:hover .fomo-token-name,
        .fomo-card-link:hover {
            color: var(--fomo-accent);
        }

        .fomo-card-link {
            text-decoration: none;
        }

        .fomo-card-logo {
            display: block;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 0.32rem;
            object-fit: cover;
        }

        /* Fomo buys are deliberately dense: identity first, then a single
           transaction line that remains readable in 350px tracker windows. */
        .fomo-buy-card {
            --tweet-card-gap: 0.42rem;
        }

        .fomo-buy-inner {
            gap: 0.42rem;
        }

        .fomo-buy-header,
        .fomo-buy-detail,
        .fomo-buy-token {
            display: flex;
            align-items: center;
            min-width: 0;
        }

        .fomo-buy-header {
            gap: 0.35rem;
            padding-right: 3rem;
        }

        .fomo-buy-avatar,
        .fomo-buy-token-image {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            overflow: hidden;
            border-radius: 50%;
            background: var(--theme-bg-tertiary);
            color: var(--theme-text-secondary);
            font-size: var(--feed-fs-3xs);
            font-weight: 700;
            text-decoration: none;
        }

        .fomo-buy-avatar {
            width: 1.5rem;
            height: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .fomo-buy-avatar img,
        .fomo-buy-token-image > img:not(.fomo-buy-token-source) {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .fomo-buy-author {
            overflow: hidden;
            max-width: min(11rem, 58vw);
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-lg);
            font-weight: 650;
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-decoration: none;
        }

        .fomo-buy-author:hover,
        .fomo-buy-token:hover .fomo-buy-ticker {
            color: #4ade80;
        }

        .fomo-buy-badge {
            display: inline-flex;
            align-items: center;
            flex: 0 0 auto;
            padding: 1px 0.28rem;
            border-radius: 3px;
            background: rgba(34, 197, 94, 0.16);
            color: #4ade80;
            font-size: var(--feed-fs-3xs);
            font-weight: 750;
            line-height: 1.2;
        }

        .fomo-buy-detail {
            flex-wrap: wrap;
            gap: 0.28rem;
            padding-left: 1.85rem;
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-lg);
            font-variant-numeric: tabular-nums;
            line-height: 1.25;
        }

        .fomo-buy-token {
            gap: 0.3rem;
            color: inherit;
            text-decoration: none;
        }

        .fomo-buy-token-image {
            width: 1.25rem;
            height: 1.25rem;
            overflow: visible;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .fomo-buy-token-image > img:not(.fomo-buy-token-source) {
            border-radius: 50%;
        }

        .fomo-buy-token-source {
            position: absolute;
            right: -0.14rem;
            bottom: -0.12rem;
            z-index: 2;
            width: 0.52rem;
            height: 0.52rem;
            border: 1px solid var(--theme-bg-card);
            border-radius: 50%;
            object-fit: cover;
        }

        .fomo-buy-ticker,
        .fomo-buy-amount,
        .fomo-buy-market-cap {
            font-weight: 700;
        }

        .fomo-buy-ticker {
            overflow: hidden;
            max-width: 7.5rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .fomo-buy-at,
        .fomo-buy-market-label {
            color: var(--theme-text-muted);
            font-weight: 500;
        }

        .fomo-buy-market-label {
            font-size: var(--feed-fs-xs);
        }

        .fomo-buy-card a:focus-visible {
            outline: 2px solid #4ade80;
            outline-offset: 2px;
        }

        .fomo-token-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-width: 0;
            gap: 0.75rem;
        }

        .fomo-token-main {
            display: flex;
            align-items: center;
            min-width: 0;
            gap: 0.4rem;
            color: inherit;
            text-decoration: none;
        }

        .fomo-token-image {
            width: 1.35rem;
            height: 1.35rem;
            flex: 0 0 auto;
            border-radius: 50%;
            font-size: var(--feed-fs-3xs);
        }

        .fomo-token-identity {
            display: flex;
            align-items: baseline;
            min-width: 0;
            gap: 0.3rem;
        }

        .fomo-token-name {
            overflow: hidden;
            color: var(--theme-text-primary);
            font-size: var(--feed-fs-md);
            font-weight: 650;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .fomo-position-values {
            display: flex;
            align-items: baseline;
            justify-content: flex-end;
            flex: 0 0 auto;
            gap: 0.3rem;
            font-size: var(--feed-fs-sm);
            white-space: nowrap;
        }

        .fomo-position-values strong {
            color: var(--theme-text-primary);
            font-weight: 650;
        }

        .fomo-pnl-value {
            font-weight: 550;
        }

        .fomo-pnl-value.positive { color: #21c95e; }
        .fomo-pnl-value.negative { color: #ef5b67; }
        .fomo-pnl-value.neutral { color: var(--theme-text-muted); }

        .fomo-thesis-text {
            margin-top: 0.5rem;
            color: var(--theme-text-primary);
            line-height: 1.4;
            white-space: pre-wrap;
        }

        .fomo-thesis-card .ca-simple {
            margin-top: var(--tweet-card-gap);
            margin-bottom: 0;
        }

        .fomo-thesis-card a:focus-visible {
            outline: 2px solid var(--fomo-accent);
            outline-offset: 2px;
        }

        @media (max-width: 520px) {
            .fomo-token-row {
                align-items: flex-start;
                flex-direction: column;
                gap: 0.35rem;
            }

            .fomo-position-values {
                justify-content: flex-start;
            }

            .fomo-buy-detail {
                align-items: center;
                flex-direction: row;
                gap: 0.25rem;
            }
        }
    