/* Security Armor: Anti-Select & Anti-Inspect */
        *, *::before, *::after {
            -webkit-user-select: none !important;
            -moz-user-select: none !important;
            -ms-user-select: none !important;
            user-select: none !important;
            -webkit-touch-callout: none !important;
        }
        input, textarea {
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
        }

        :root {
            /* Surface Tokens — Institutional Dark */
            --bg: #0c1017;
            --surface: #131923;
            --raised: #1b2330;
            --raised-hover: #243042;
            --line: #293342;
            --line-subtle: rgba(255, 255, 255, 0.05);
            
            /* Text Tokens */
            --text: #eef2f6;
            --muted: #9caabd;
            --dim: #5a697e;
            
            /* Semantic Accent Tokens */
            --accent: #10b981;
            --accent-soft: rgba(16, 185, 129, 0.14);
            --green: #95d8b3;
            --green-soft: rgba(149, 216, 179, 0.12);
            --red: #f2a5a5;
            --red-soft: rgba(242, 165, 165, 0.14);
            --amber: #edca8b;
            --amber-soft: rgba(237, 202, 139, 0.12);
            --cyan: #38bdf8;
            --purple: #c084fc;
            
            --radius: 12px;
            --radius-sm: 8px;
            --radius-xs: 4px;

            --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-mono: 'JetBrains Mono', Consolas, monospace;
        }

        /* Light Mode Tokens — Soft Institutional Matte Slate (Zero Glare, Eye-Friendly) */
        html[data-theme="light"] {
            --bg: #e6ebf2;
            --surface: #edf1f7;
            --raised: #e0e5ed;
            --raised-hover: #d3dbe6;
            --line: #c8d1de;
            --line-subtle: rgba(0, 0, 0, 0.06);
            
            --text: #1e293b;
            --muted: #475569;
            --dim: #64748b;
            
            --accent: #15803d;
            --accent-soft: rgba(21, 128, 61, 0.12);
            --green: #15803d;
            --green-soft: rgba(21, 128, 61, 0.12);
            --red: #b91c1c;
            --red-soft: rgba(185, 28, 28, 0.12);
            --amber: #b45309;
            --amber-soft: rgba(180, 83, 9, 0.12);
            --cyan: #0369a1;
            --purple: #6d28d9;
        }

        /* Typography Binding */
        html[lang="en"], html[data-lang="en"] {
            --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
        }
        html[lang="th"], html[data-lang="th"] {
            --font-sans: 'Prompt', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
        }

        /* Reset & Base */
        *, *::before, *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background-color: var(--bg);
            color: var(--text);
            font-family: var(--font-sans);
            font-size: 13px;
            line-height: 1.5;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .container {
            max-width: 1440px;
            margin: 0 auto;
            padding: 16px 20px 48px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        /* Typography Helpers */
        h1, h2, h3, h4, p { margin: 0; }
        .mono, .number {
            font-family: var(--font-mono);
            font-variant-numeric: tabular-nums;
        }
        .text-muted { color: var(--muted); }
        .text-dim { color: var(--dim); }

        /* Unified Button System */
        .button {
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 7px 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 12px;
            font-weight: 500;
            font-family: var(--font-sans);
            color: var(--text);
            text-decoration: none;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            line-height: 1;
        }
        .button:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--raised-hover);
        }
        .button.primary {
            background: var(--accent);
            color: #0c1017;
            border-color: var(--accent);
            font-weight: 600;
        }
        .button.primary:hover {
            filter: brightness(1.08);
        }
        html[data-theme="light"] .button.primary {
            color: #ffffff;
        }

        /* Header / Masthead */
        .masthead {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            gap: 16px;
        }

        .brand-area {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .brand-mark {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            background: var(--accent-soft);
            border: 1px solid var(--accent);
            color: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 18px;
            flex-shrink: 0;
        }

        .brand-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .brand-title-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .brand-name {
            font-weight: 700;
            font-size: 15px;
            letter-spacing: -0.01em;
            color: var(--text);
        }

        .status-indicator {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--green);
            background: var(--green-soft);
            padding: 2px 8px;
            border-radius: 12px;
            border: 1px solid rgba(149, 216, 179, 0.25);
            font-weight: 500;
        }

        .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
            box-shadow: 0 0 6px currentColor;
        }

        .status-badge-subtle {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--dim);
            padding: 2px 6px;
            background: var(--raised);
            border-radius: var(--radius-xs);
            border: 1px solid var(--line);
        }

        .brand-subtitle {
            font-size: 11px;
            color: var(--muted);
        }

        .masthead-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: nowrap;
        }

        /* Unified 32px Institutional Controls */
        .masthead-controls #btnUpgradePro {
            height: 32px;
            padding: 0 12px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.02em;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: var(--radius-sm);
            box-sizing: border-box;
            white-space: nowrap;
            border: none;
            cursor: pointer;
            background: var(--accent);
            color: #0c1017;
            transition: opacity 0.15s ease, transform 0.15s ease;
        }

        .masthead-controls #btnUpgradePro:hover {
            opacity: 0.92;
            transform: translateY(-1px);
        }

        /* Segmented Language Switcher (Standardized 32px height) */
        .segmented-control {
            display: inline-flex;
            align-items: center;
            height: 32px;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 2px;
            gap: 2px;
            box-sizing: border-box;
        }
        .seg-btn {
            height: 26px;
            line-height: 26px;
            background: transparent;
            border: none;
            color: var(--muted);
            font-size: 11px;
            font-weight: 600;
            font-family: var(--font-mono);
            padding: 0 9px;
            border-radius: var(--radius-xs);
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }
        .seg-btn.active {
            background: var(--surface);
            color: var(--accent);
            border: 1px solid var(--line);
        }

        /* Theme Toggle Button (Standardized 32px height) */
        .masthead-controls #themeToggleBtn {
            height: 32px;
            padding: 0 11px;
            font-size: 11px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: var(--radius-sm);
            box-sizing: border-box;
            white-space: nowrap;
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--muted);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .masthead-controls #themeToggleBtn:hover {
            color: var(--text);
            border-color: var(--line-active);
            background: var(--surface);
        }

        /* Sign In Button (Standardized 32px height) */
        .masthead-controls #btnTermGoogleSignIn {
            height: 32px;
            padding: 0 12px;
            font-size: 11px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: var(--radius-sm);
            box-sizing: border-box;
            white-space: nowrap;
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--text);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .masthead-controls #btnTermGoogleSignIn:hover {
            background: var(--surface);
            border-color: var(--line-active);
        }

        /* User Profile Bar (Standardized 32px height) */
        .masthead-controls #termUserProfileBar {
            height: 32px;
            padding: 0 10px;
            font-size: 11px;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            border-radius: var(--radius-sm);
            box-sizing: border-box;
            white-space: nowrap;
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--text);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .masthead-controls #termUserProfileBar:hover {
            background: var(--surface);
            border-color: var(--accent);
        }

        /* PWA Install Button */
        .masthead-controls #btnInstallPwa {
            height: 32px;
            padding: 0 10px;
            font-size: 11px;
            font-weight: 600;
            border-radius: var(--radius-sm);
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--muted);
            cursor: pointer;
        }

        /* Search Hero Omnibar */
        .search-hero-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .search-input-group {
            display: flex;
            gap: 10px;
        }

        .search-hero-input {
            flex: 1;
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--text);
            border-radius: var(--radius-sm);
            padding: 10px 16px;
            font-size: 13px;
            outline: none;
            font-family: var(--font-sans);
            transition: border-color 0.15s ease;
        }
        .search-hero-input:focus {
            border-color: var(--accent);
        }

        .btn-search-divine {
            background: var(--accent);
            color: #0c1017;
            border: none;
            padding: 10px 20px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            font-family: var(--font-sans);
            transition: all 0.15s ease;
        }
        .btn-search-divine:hover {
            filter: brightness(1.08);
        }
        html[data-theme="light"] .btn-search-divine {
            color: #ffffff;
        }

        .quick-chips-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .chip-label {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 600;
            margin-right: 4px;
        }

        .quick-chip {
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--text);
            border-radius: var(--radius-xs);
            padding: 4px 10px;
            font-size: 11px;
            font-family: var(--font-mono);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .quick-chip:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--raised-hover);
        }

        /* Stream Section Layout Containers */
        #secHeaderAndMatrix, #secDetailsAndNews {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        /* Stock Hero Header */
        .stock-hero-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 20px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            flex-wrap: wrap;
            gap: 14px;
        }

        .stock-title-cluster {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .ticker-pill-huge {
            font-family: var(--font-mono);
            font-size: 24px;
            font-weight: 800;
            color: var(--accent);
            background: var(--accent-soft);
            border: 1px solid var(--accent);
            padding: 4px 14px;
            border-radius: var(--radius-sm);
            letter-spacing: 0.04em;
        }

        .company-meta {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .company-name {
            font-size: 16px;
            font-weight: 700;
            color: var(--text);
        }

        .sector-tag {
            font-size: 12px;
            color: var(--muted);
        }

        .stock-badges-cluster {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* Action Decision Badges */
        .action-badge-container {
            position: relative;
            display: inline-block;
        }

        .action-decision-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            height: 32px;
            padding: 0 12px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.02em;
            box-sizing: border-box;
            user-select: none;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .badge-buy-opp {
            background: var(--green-soft);
            color: var(--green);
            border: 1px solid rgba(149, 216, 179, 0.35);
        }
        .badge-hard-exit {
            background: var(--red-soft);
            color: var(--red);
            border: 1px solid rgba(242, 165, 165, 0.35);
        }
        .badge-wait-dip {
            background: var(--amber-soft);
            color: var(--amber);
            border: 1px solid rgba(237, 202, 139, 0.35);
        }

        .rules-popover-box {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            width: 320px;
            max-width: calc(100vw - 32px);
            box-sizing: border-box;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 14px;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
            z-index: 1000;
            display: none;
            flex-direction: column;
            gap: 8px;
        }
        .action-badge-container:hover .rules-popover-box {
            display: flex;
        }

        .popover-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 700;
            font-size: 11px;
            border-bottom: 1px solid var(--line);
            padding-bottom: 6px;
            color: var(--text);
        }

        .popover-rule-item {
            font-size: 11px;
            color: var(--muted);
            line-height: 1.4;
        }

        .tier-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            height: 32px;
            padding: 0 12px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            border: 1px solid var(--line);
            background: var(--raised);
            color: var(--text);
            box-sizing: border-box;
            user-select: none;
            line-height: 1;
            white-space: nowrap;
        }
        .tier-s {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-soft);
        }
        .tier-a {
            border-color: var(--cyan);
            color: var(--cyan);
            background: rgba(56, 189, 248, 0.1);
        }

        .share-thesis-badge-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            height: 32px;
            padding: 0 12px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            background: linear-gradient(135deg, rgba(21, 128, 61, 0.22), rgba(3, 105, 161, 0.22));
            border: 1px solid var(--accent);
            color: var(--text);
            cursor: pointer;
            box-sizing: border-box;
            user-select: none;
            line-height: 1;
            white-space: nowrap;
            text-decoration: none;
            transition: all 0.15s ease;
        }
        .share-thesis-badge-btn:hover {
            background: linear-gradient(135deg, rgba(21, 128, 61, 0.38), rgba(3, 105, 161, 0.38));
            border-color: #ffffff;
            color: #ffffff;
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
        }

        .btn-save-plan {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            height: 32px;
            padding: 0 12px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            background: var(--accent);
            border: 1px solid var(--accent);
            color: #080d14;
            cursor: pointer;
            box-sizing: border-box;
            user-select: none;
            line-height: 1;
            white-space: nowrap;
            text-decoration: none;
            transition: all 0.15s ease;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
        }
        .btn-save-plan:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
        }
        .btn-save-plan:active {
            transform: translateY(0);
        }
        .btn-save-plan:disabled {
            opacity: 0.7;
            cursor: not-allowed;
            transform: none;
        }

        /* 3-Tranche Blueprint Box */
        .tranches-blueprint-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .tranches-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .tranches-title {
            font-weight: 700;
            font-size: 14px;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sizing-badge-pill {
            font-family: var(--font-mono);
            font-size: 11px;
            background: var(--raised);
            border: 1px solid var(--line);
            padding: 3px 10px;
            border-radius: 12px;
            color: var(--muted);
        }

        /* Capital Sizing Stepper & Quick Presets (Institutional Control) */
        .capital-sizing-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .capital-sizing-bar.pro-frosted-locked {
            position: relative;
            overflow: hidden;
            user-select: none;
        }

        .pro-frosted-overlay {
            position: absolute;
            inset: 0;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            background: rgba(12, 16, 23, 0.82);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            z-index: 10;
            border-radius: var(--radius-sm);
            gap: 12px;
        }

        .pro-frosted-banner-left {
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .pro-lock-badge-icon {
            width: 24px;
            height: 24px;
            border-radius: 4px;
            background: rgba(16, 185, 129, 0.18);
            border: 1px solid rgba(16, 185, 129, 0.4);
            color: #10b981;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            flex-shrink: 0;
        }

        .pro-frosted-title {
            font-size: 12px;
            font-weight: 700;
            color: #ffffff;
            letter-spacing: -0.2px;
        }

        .pro-frosted-sub {
            font-size: 11px;
            color: var(--muted);
        }

        .pro-frosted-cta-btn {
            background: var(--accent);
            color: #0c1017;
            font-weight: 800;
            font-size: 11px;
            padding: 6px 14px;
            border-radius: 4px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .pro-frosted-cta-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
        }

        /* Dilution Radar Card with Frosted Paywall Support */
        .dilution-radar-card {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .dilution-radar-card.pro-frosted-locked .dilution-radar-content {
            filter: blur(6px);
            pointer-events: none;
            user-select: none;
        }

        /* FinTwit Infographic Generator Modal Styling */
        .fintwit-modal-card {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 24px;
            width: 100%;
            max-width: 880px;
            max-height: 92vh;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 16px;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95);
        }

        .fintwit-canvas-preview-wrap {
            position: relative;
            width: 100%;
            height: 420px;
            max-height: 52vh;
            background: #0b0f17;
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            padding: 10px;
            box-sizing: border-box;
        }

        .fintwit-canvas-preview-wrap canvas {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
        }

        .fintwit-actions-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--line);
        }

        /* Unified Share Link & Social Dispatch Styling */
        .share-section-title {
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--dim);
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .share-link-group {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 6px 10px;
        }

        .share-link-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--text);
            font-size: 12px;
            font-family: var(--font-mono);
            min-width: 0;
        }

        .social-dispatch-cluster {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .social-share-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, 0.1);
            line-height: 1;
            transition: all 0.15s ease;
            user-select: none;
            box-sizing: border-box;
        }

        .social-share-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
            filter: brightness(1.15);
        }

        .social-share-btn.btn-x {
            background: #000000;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
        }

        .social-share-btn.btn-stocktwits {
            background: #192a3e;
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.35);
        }

        .social-share-btn.btn-linkedin {
            background: #0a66c2;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .social-share-btn.btn-telegram {
            background: #229ed9;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .social-share-btn.btn-whatsapp {
            background: #25d366;
            color: #0c1017;
            border-color: rgba(0, 0, 0, 0.2);
        }

        .social-share-btn.btn-reddit {
            background: #ff4500;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .social-share-btn.btn-facebook {
            background: #1877f2;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .social-share-btn.btn-instagram,
        .social-share-btn.btn-ig-story {
            background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
            font-weight: 700;
        }

        .social-share-btn.btn-fb-story {
            background: linear-gradient(135deg, #1877f2, #00c6ff);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
            font-weight: 700;
        }

        .social-share-btn.btn-ig-feed {
            background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
            font-weight: 600;
        }

        .social-share-btn.btn-facebook,
        .social-share-btn.btn-fb-feed {
            background: #1877f2;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
            font-weight: 600;
        }

        .social-share-btn.btn-threads {
            background: #000000;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.3);
        }

        .social-share-btn.btn-native {
            background: linear-gradient(135deg, #10b981, #0284c7);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
            font-weight: 700;
        }

        .capital-controls-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .capital-preset-chips {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            flex-wrap: wrap;
        }

        .capital-preset-chip {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 11px;
            font-family: var(--font-mono);
            font-weight: 500;
            color: var(--muted);
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            line-height: 1.1;
        }

        .capital-preset-chip:hover {
            background: var(--raised-hover);
            color: var(--text);
            border-color: var(--dim);
        }

        .capital-preset-chip.active {
            background: var(--accent-soft);
            border-color: var(--accent);
            color: var(--accent);
            font-weight: 700;
        }

        .capital-stepper-container {
            display: inline-flex;
            align-items: center;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 2px;
            transition: all 0.15s ease;
        }

        .capital-stepper-container:focus-within,
        .capital-stepper-container:hover {
            border-color: var(--accent);
            box-shadow: 0 0 0 1px var(--accent-soft);
        }

        .capital-stepper-btn {
            background: transparent;
            border: none;
            color: var(--muted);
            width: 24px;
            height: 24px;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 11px;
            transition: all 0.12s ease;
            user-select: none;
        }

        .capital-stepper-btn:hover {
            background: var(--raised-hover);
            color: var(--accent);
        }

        .capital-stepper-btn:active {
            transform: scale(0.90);
        }

        .capital-input-wrapper {
            position: relative;
            display: inline-flex;
            align-items: center;
            padding: 0 4px;
        }

        .capital-currency-prefix {
            color: var(--accent);
            font-family: var(--font-mono);
            font-size: 12px;
            font-weight: 700;
            user-select: none;
            margin-right: 2px;
        }

        #capitalInput,
        .capital-clean-input {
            background: transparent !important;
            border: none !important;
            color: var(--text) !important;
            font-size: 13px !important;
            font-weight: 700 !important;
            font-family: var(--font-mono) !important;
            outline: none !important;
            box-shadow: none !important;
            width: 68px !important;
            padding: 2px 0 !important;
            text-align: left !important;
            -moz-appearance: textfield !important;
            appearance: textfield !important;
        }

        /* Suppress native browser up/down arrow spinners completely */
        #capitalInput::-webkit-outer-spin-button,
        #capitalInput::-webkit-inner-spin-button,
        .capital-clean-input::-webkit-outer-spin-button,
        .capital-clean-input::-webkit-inner-spin-button {
            -webkit-appearance: none !important;
            margin: 0 !important;
            display: none !important;
        }

        .tranches-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .tranche-card {
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            position: relative;
        }

        .tranche-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .tranche-name {
            font-size: 12px;
            font-weight: 700;
            color: var(--text);
        }

        .tranche-pct-pill {
            font-family: var(--font-mono);
            font-size: 10px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: var(--radius-xs);
            background: var(--surface);
            border: 1px solid var(--line);
            color: var(--accent);
        }

        .tranche-price-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 4px;
        }

        .tranche-price {
            font-family: var(--font-mono);
            font-size: 20px;
            font-weight: 800;
            color: var(--text);
        }

        .btn-copy-price {
            background: var(--surface);
            border: 1px solid var(--line);
            color: var(--muted);
            padding: 4px 8px;
            border-radius: var(--radius-xs);
            font-size: 11px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.15s ease;
        }
        .btn-copy-price:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .tranche-condition {
            font-size: 11px;
            color: var(--dim);
            line-height: 1.4;
            border-top: 1px solid var(--line);
            padding-top: 6px;
        }

        /* Quant Unified Matrix */
        .quant-matrix-box {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 10px;
        }

        .q-item {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .q-label {
            font-size: 10px;
            color: var(--muted);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .q-val {
            font-family: var(--font-mono);
            font-size: 14px;
            font-weight: 700;
            color: var(--text);
        }

        .q-target { color: var(--green); }
        .q-stoploss { color: var(--red); }
        .q-rr { color: var(--accent); }
        .q-vol { color: var(--muted); }

        .q-model-note { grid-column: 1 / -1; color: var(--muted); font-size: 11px;
            line-height: 1.5; padding: 2px 4px; }

        /* TradingView Wrapper */
        .tv-wrapper {
            height: 480px;
            min-height: 440px;
            border-radius: var(--radius);
            overflow: hidden;
            border: 1px solid var(--line);
            background: var(--surface);
        }

        /* Carlota Perez Macro Meter */
        .macro-meter-box {
            padding: 18px 20px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .macro-meter-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .resilience-pill {
            font-family: var(--font-mono);
            font-size: 11px;
            color: var(--green);
            background: var(--green-soft);
            border: 1px solid rgba(149, 216, 179, 0.3);
            padding: 3px 10px;
            border-radius: 12px;
            font-weight: 600;
        }

        .perez-track {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }

        .perez-step {
            padding: 10px 12px;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            display: flex;
            flex-direction: column;
            gap: 3px;
            transition: all 0.15s ease;
        }
        .perez-step.active {
            background: var(--accent-soft);
            border-color: var(--accent);
        }

        .perez-step-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .perez-num {
            font-size: 10px;
            font-family: var(--font-mono);
            font-weight: 600;
            color: var(--dim);
        }
        .perez-step.active .perez-num {
            color: var(--accent);
        }

        .perez-name {
            font-size: 12px;
            font-weight: 600;
            color: var(--text);
        }

        .perez-sub {
            font-size: 10px;
            color: var(--muted);
        }

        .perez-desc {
            font-size: 11px;
            color: var(--dim);
            line-height: 1.3;
            margin-top: 2px;
        }

        .active-dot-pill {
            font-size: 9px;
            font-family: var(--font-mono);
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 4px;
            background: var(--green);
            color: #0c1017;
        }

        /* Macro Guide Accordion */
        .macro-guide-accordion {
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
        }
        .macro-guide-summary {
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            color: var(--muted);
            display: flex;
            justify-content: space-between;
            user-select: none;
        }
        .macro-guide-content {
            margin-top: 10px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .stack-layer-item {
            font-size: 11px;
            color: var(--text);
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding-left: 8px;
            border-left: 2px solid var(--line);
        }
        .layer-badge {
            font-family: var(--font-mono);
            font-size: 10px;
            font-weight: 600;
        }

        /* Radar Table */
        .radar-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }
        .radar-table th {
            text-align: left;
            padding: 8px 10px;
            background: var(--raised);
            color: var(--muted);
            font-weight: 600;
            border-bottom: 1px solid var(--line);
            font-size: 11px;
            text-transform: uppercase;
        }
        .radar-table td {
            padding: 8px 10px;
            border-bottom: 1px solid var(--line);
            color: var(--text);
        }
        .radar-tag {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-family: var(--font-mono);
            font-weight: 600;
        }
        .impact-high {
            background: var(--red-soft);
            color: var(--red);
            border: 1px solid rgba(242, 165, 165, 0.3);
        }

        /* Evidence Stack Box */
        .evidence-stack-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .evidence-item {
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        .ev-idx-circle {
            background: var(--surface);
            border: 1px solid var(--line);
            color: var(--accent);
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 11px;
            font-family: var(--font-mono);
            flex-shrink: 0;
        }

        .ev-content { flex: 1; }
        .ev-headline {
            font-weight: 600;
            color: var(--text);
            font-size: 12px;
        }
        .ev-meta {
            font-size: 11px;
            color: var(--muted);
            margin-top: 3px;
        }
        .evidence-empty { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
        .ev-source-quote { color: var(--muted); font-size: 11px; margin-top: 5px; }
        .ev-source-quote summary { cursor: pointer; color: var(--accent); }
        .ev-source-link { display: inline-block; color: var(--accent); font-size: 11px; margin-top: 5px; }

        /* Thesis Playbook Box */
        .thesis-playbook-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        /* News Article Cards */
        .news-article-card {
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 14px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: border-color 0.15s ease;
        }
        .news-article-card:hover {
            border-color: var(--accent);
        }

        .news-card-header,
        .news-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .news-tier-badge {
            font-size: 10px;
            font-family: var(--font-mono);
            font-weight: 600;
            padding: 2px 7px;
            border-radius: 4px;
            background: var(--surface);
            border: 1px solid var(--line);
            color: var(--accent);
        }

        .news-source {
            font-size: 11px;
            color: var(--muted);
            font-family: var(--font-mono);
        }

        .news-date {
            font-size: 11px;
            color: var(--muted);
            font-family: var(--font-mono);
        }

        .news-article-title,
        .news-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.4;
        }

        .news-article-summary-box,
        .news-summary {
            background: var(--surface);
            border-left: 3px solid var(--accent);
            padding: 10px 12px;
            border-radius: 4px;
            font-size: 12px;
            color: var(--text);
            line-height: 1.5;
            white-space: pre-line;
            word-break: break-word;
        }

        .news-analysis-depth { color: var(--accent); font-size: 11px; font-weight: 700; }
        .news-analysis-section { color: var(--muted); font-size: 12px; line-height: 1.55; }
        .news-analysis-section strong { color: var(--text); }
        .news-analysis-section p { margin: 5px 0 0; }
        .news-analysis-section ul { margin: 6px 0 0; padding-left: 18px; }
        .news-analysis-section li { margin-bottom: 7px; overflow-wrap: anywhere; }
        .news-analysis-section small { display: block; color: var(--dim); font-size: 10px; margin-top: 3px; }
        .news-source-quote { margin-top: 4px; color: var(--dim); font-size: 10px; }
        .news-source-quote summary { display: inline-block; cursor: pointer; color: var(--accent); }
        .news-source-quote summary:hover { text-decoration: underline; }

        .news-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-top: 4px;
        }

        .news-link {
            font-size: 11px;
            color: var(--cyan);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-weight: 600;
        }
        .news-link:hover {
            text-decoration: underline;
        }
        .news-other-coverage { border:1px solid var(--line); border-radius:10px; padding:12px 16px; color:var(--muted); background:var(--panel); font-size:12px; }
        .news-other-coverage summary { cursor:pointer; color:var(--text); font-weight:700; }
        .news-other-coverage > p { margin:10px 0; }
        .news-coverage-item { border-top:1px solid var(--line); padding:10px 0; line-height:1.5; }
        .news-coverage-item small { display:block; margin-top:3px; color:var(--muted); }
        .news-coverage-links { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:7px; }
        .news-coverage-links a { color:var(--accent); text-decoration:none; }
        .news-coverage-links a:hover { text-decoration:underline; }

        .proof-source-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 4px;
            background: var(--surface);
            border: 1px solid var(--line);
            color: var(--muted);
            font-size: 11px;
            text-decoration: none;
            transition: all 0.15s ease;
        }
        .proof-source-chip:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        /* Toast Notification */
        .toast-notification {
            position: fixed;
            bottom: 24px;
            right: 24px;
            padding: 10px 16px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-size: 12px;
            font-weight: 500;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
            z-index: 99999;
            opacity: 0;
            transform: translateY(10px);
            pointer-events: none;
            transition: all 0.2s ease;
        }
        .toast-notification.show {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .container { padding: 14px 16px 36px; }
            .quant-matrix-box { grid-template-columns: repeat(3, 1fr); }
            .tranches-grid { grid-template-columns: repeat(3, 1fr); }
            .tv-wrapper { height: 380px; min-height: 380px; }
        }

        @media (max-width: 768px) {
            .masthead {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
                padding: 12px 14px;
            }
            .masthead-controls {
                justify-content: flex-start;
                flex-wrap: wrap;
                width: 100%;
                gap: 6px;
            }
            .macro-telemetry-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                padding: 10px 12px;
            }
            .macro-left-group {
                justify-content: space-between;
                width: 100%;
            }
            .view-mode-tabs {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                width: 100%;
            }
            .event-tape-badge {
                display: none !important;
            }
            .view-mode-btn {
                justify-content: center;
                padding: 6px 4px;
                font-size: 11px;
            }
            .quick-chips-row {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                padding-bottom: 6px;
            }
            .quick-chips-row .chip-label,
            .quick-chips-row .quick-chip {
                flex-shrink: 0;
            }
            .stock-hero-header {
                flex-direction: column;
                align-items: flex-start;
                padding: 12px 14px;
                gap: 12px;
            }
            .stock-badges-cluster {
                width: 100%;
                justify-content: flex-start;
            }
            .share-thesis-badge-btn {
                width: 100%;
                justify-content: center;
            }
            .radar-table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                width: 100%;
            }
            .tranches-grid { grid-template-columns: 1fr; }
            .quant-matrix-box { grid-template-columns: repeat(2, 1fr); }
            .perez-track { grid-template-columns: 1fr 1fr; }
            .search-input-group { flex-direction: column; }
            .tv-wrapper { height: 320px; min-height: 320px; }
            .capital-sizing-bar.pro-frosted-locked {
                min-height: 130px;
            }
            .pro-frosted-overlay {
                flex-direction: column;
                justify-content: center;
                align-items: stretch;
                padding: 12px;
                gap: 8px;
            }
            .pro-frosted-banner-left {
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 4px;
            }
            .pro-frosted-cta-btn {
                width: 100%;
                justify-content: center;
                text-align: center;
            }
        }

        @media (max-width: 540px) {
            .view-mode-tabs {
                grid-template-columns: repeat(2, 1fr);
                gap: 4px;
            }
            .view-mode-btn {
                padding: 7px 6px;
                font-size: 11px;
            }
        }

        @media (max-width: 480px) {
            .container { padding: 10px 10px 28px; }
            .quant-matrix-box { grid-template-columns: 1fr 1fr; gap: 8px; }
            .quant-matrix-box .q-item:last-child { grid-column: span 2; }
            .perez-track { grid-template-columns: 1fr; }
            .brand-title-row { flex-wrap: wrap; gap: 4px; }
            .brand-subtitle { font-size: 11px; }
            #statEngineBadge { display: none; }
            .stock-title-cluster { flex-wrap: wrap; gap: 8px; }
            .ticker-pill-huge { font-size: 20px; padding: 3px 10px; }
            .news-article-card { padding: 12px; }
            .evidence-stack-box { padding: 12px; }
            .tv-wrapper { height: 280px; min-height: 280px; }
            .paywall-plans-grid { grid-template-columns: 1fr !important; }
            .modal-overlay > div { width: 95% !important; max-width: 95% !important; padding: 18px 14px !important; margin: auto; }
        }

        /* FinTwit Preview Img & Theme Switcher */
        .fintwit-canvas-preview-wrap img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
            image-rendering: auto;
        }

        .card-theme-toggle {
            display: inline-flex;
            align-items: center;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: 20px;
            padding: 2px;
            gap: 2px;
        }

        .card-theme-btn {
            background: none;
            border: none;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 700;
            color: var(--muted);
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.15s ease;
            line-height: 1;
        }

        .card-theme-btn.active {
            background: var(--surface);
            color: var(--text);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        .card-aspect-toggle {
            display: inline-flex;
            align-items: center;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: 20px;
            padding: 2px;
            gap: 2px;
        }

        .card-aspect-btn {
            background: none;
            border: none;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 700;
            color: var(--muted);
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.15s ease;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .card-aspect-btn:hover {
            color: var(--text);
        }

        .card-aspect-btn.active {
            background: var(--surface);
            color: var(--cyan);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        html[data-theme="light"] .fintwit-canvas-preview-wrap {
            background: #e2e8f0;
        }

        /* Pro Frosted Component Base Styles */
        .pro-frosted-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: 8px;
            width: 100%;
            padding: 16px;
        }

        .pro-frosted-pill {
            font-size: 10px;
            font-family: var(--font-mono);
            font-weight: 700;
            color: var(--accent);
            background: var(--accent-soft);
            border: 1px solid var(--accent);
            padding: 2px 8px;
            border-radius: 999px;
            text-transform: uppercase;
        }

        .pro-frosted-btn {
            background: var(--accent);
            color: #0c1017;
            font-weight: 800;
            font-size: 12px;
            padding: 8px 18px;
            border-radius: var(--radius-sm);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .pro-frosted-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
        }

        /* Base Modal Overlay Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        #googleAuthModal {
            z-index: 10000;
        }

        .modal-overlay > div {
            max-height: 90vh;
            max-height: 90dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            box-sizing: border-box;
            margin: auto;
        }

        /* Universal Terminal Confirmation Dialog */
        .confirm-dialog-card {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 28px 24px 24px;
            width: 100%;
            max-width: 420px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 16px;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.92);
            position: relative;
            box-sizing: border-box;
            animation: confirmScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes confirmScaleIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(8px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .confirm-dialog-close {
            position: absolute;
            top: 14px;
            right: 14px;
            background: none;
            border: none;
            color: var(--dim);
            font-size: 15px;
            cursor: pointer;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.15s ease;
        }

        .confirm-dialog-close:hover {
            color: var(--text);
            background: var(--raised);
        }

        .confirm-dialog-icon-wrap {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: rgba(248, 113, 113, 0.12);
            border: 1px solid rgba(248, 113, 113, 0.35);
            color: var(--red);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            flex-shrink: 0;
        }

        .confirm-dialog-text-wrap {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }

        .confirm-dialog-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            margin: 0;
            letter-spacing: -0.3px;
            font-family: var(--font-sans);
        }

        .confirm-dialog-message {
            font-size: 13px;
            color: var(--muted);
            line-height: 1.5;
            margin: 0;
            word-break: break-word;
            font-family: var(--font-sans);
        }

        .confirm-dialog-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            width: 100%;
            margin-top: 6px;
        }

        .confirm-dialog-actions .button {
            flex: 1;
            padding: 10px 16px;
            font-size: 12.5px;
            border-radius: var(--radius-xs);
            cursor: pointer;
            justify-content: center;
        }

        .confirm-btn-cancel {
            background: var(--raised);
            border: 1px solid var(--line);
            color: var(--text);
            font-weight: 600;
        }

        .confirm-btn-cancel:hover {
            background: var(--raised-hover);
            border-color: var(--dim);
            color: var(--text);
        }

        .confirm-btn-dismiss {
            background: transparent;
            border: 1px solid var(--line);
            color: var(--muted);
            font-weight: 500;
        }

        .confirm-btn-dismiss:hover {
            background: var(--raised-hover);
            border-color: var(--dim);
            color: var(--text);
        }

        .button.danger-solid {
            background: #ef4444;
            border: 1px solid #dc2626;
            color: #ffffff;
            font-weight: 700;
            box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
        }

        .button.danger-solid:hover {
            background: #dc2626;
            border-color: #b91c1c;
            box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
            filter: brightness(1.05);
        }


        .dilution-radar-card.pro-frosted-locked {
            position: relative !important;
            overflow: hidden !important;
            user-select: none;
        }

        /* =========================================================================
           LIGHT THEME COMPREHENSIVE OVERRIDES & REFINEMENTS
           ========================================================================= */

        /* Frosted Overlays (Paywall / Sizing locked cards) in Light Mode */
        html[data-theme="light"] .pro-frosted-overlay {
            background: rgba(248, 250, 252, 0.94);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--line);
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
        }

        html[data-theme="light"] .pro-frosted-title {
            color: var(--text);
        }

        html[data-theme="light"] .pro-frosted-sub {
            color: var(--muted);
        }

        html[data-theme="light"] .pro-lock-badge-icon {
            background: rgba(21, 128, 61, 0.12);
            border-color: rgba(21, 128, 61, 0.35);
            color: #15803d;
        }

        html[data-theme="light"] .pro-frosted-btn,
        html[data-theme="light"] .pro-frosted-cta-btn {
            background: var(--accent);
            color: #ffffff;
            box-shadow: 0 2px 10px rgba(21, 128, 61, 0.3);
        }

        /* Modal Overlays in Light Mode */
        html[data-theme="light"] .modal-overlay {
            background: rgba(15, 23, 42, 0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        html[data-theme="light"] .fintwit-modal-card {
            background: #ffffff;
            border-color: var(--line);
            box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
        }

        html[data-theme="light"] .confirm-dialog-card {
            background: #ffffff;
            border-color: var(--line);
            box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
        }

        html[data-theme="light"] .confirm-btn-cancel {
            background: #f1f5f9;
            border-color: #cbd5e1;
            color: #334155;
        }

        html[data-theme="light"] .confirm-btn-cancel:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        html[data-theme="light"] .share-thesis-badge-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: rgba(21, 128, 61, 0.15);
        }

        /* Active dot pill in light mode */
        html[data-theme="light"] .active-dot-pill {
            color: #ffffff;
            background: var(--accent);
        }

        /* StockTwits button in Light Mode */
        html[data-theme="light"] .social-share-btn.btn-stocktwits {
            background: #233b32;
            color: #ffffff;
            border-color: rgba(35, 59, 50, 0.4);
        }
/* ==========================================================================
   MACRO TELEMETRY BAR & TOP 10 ALPHA RADAR
   ========================================================================== */

.macro-telemetry-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 20px;
}

.macro-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.market-clock-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--text);
}

.market-clock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dim);
}

.market-clock-dot.is-open {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.fng-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--muted);
}

.fng-badge {
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 3px;
}

.fng-badge.fear {
    background: rgba(248, 113, 113, 0.18);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.fng-badge.greed {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.fng-badge.neutral {
    background: rgba(237, 202, 139, 0.18);
    color: var(--amber);
    border: 1px solid rgba(237, 202, 139, 0.35);
}

.view-mode-tabs {
    display: inline-flex;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
}

.view-mode-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-mode-btn.active {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.view-mode-btn:hover:not(.active) {
    color: var(--text);
}

/* TOP 10 RADAR BOARD */
.top10-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top10-header-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.top10-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.top10-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.top10-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 32px 160px 130px 90px 1fr 140px;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    color: var(--text);
}

.top10-card:hover {
    background: var(--raised);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.top10-rank {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: var(--dim);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--raised);
    display: flex;
    align-items: center;
    justify-content: center;
}

.top10-card:nth-child(2) .top10-rank { color: var(--accent); border: 1px solid var(--accent); }

.top10-stock-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top10-ticker-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top10-ticker {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.top10-co-name {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.top10-badge-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.16);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.top10-badge-watch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--raised);
    color: var(--muted);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.top10-price-box {
    text-align: right;
}

.top10-price {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.top10-change {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.top10-change.up { color: var(--accent); }
.top10-change.down { color: var(--red); }

.top10-telemetry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.top10-moat-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.top10-moat-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.top10-moat-tag.dilution-safe {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.top10-moat-tag.catalyst {
    background: rgba(6, 182, 212, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.top10-catalyst-text {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top10-atr-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top10-atr-entry {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

.top10-atr-entry.is-locked {
    color: var(--muted);
}

.top10-atr-stop {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--dim);
}

@media (max-width: 900px) {
    .top10-card {
        grid-template-columns: 28px 1fr auto auto;
        gap: 10px;
    }
    .top10-telemetry, .top10-atr-box {
        display: none;
    }
}

@media (max-width: 540px) {
    .top10-card {
        grid-template-columns: 28px 1fr auto;
        gap: 8px;
        padding: 10px 12px;
    }
    .top10-trend-box {
        display: none;
    }
    .top10-price {
        font-size: 13px;
    }
    .top10-change {
        font-size: 10px;
    }
}

/* Saved Quantitative Trade Plans Card */
.saved-plan-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 160px 110px 140px 110px 1fr auto;
    align-items: center;
    gap: 14px;
    transition: all 0.18s ease;
    color: var(--text);
}

.saved-plan-card:hover {
    background: var(--raised);
    border-color: var(--accent);
}

@media (max-width: 900px) {
    .saved-plan-card {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 14px;
    }
    .saved-plan-col-info {
        grid-column: span 2;
        border-bottom: 1px solid var(--line-subtle);
        padding-bottom: 8px;
    }
    .saved-plan-col-bands {
        grid-column: span 2;
    }
    .saved-plan-col-actions {
        grid-column: span 2;
        display: flex;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--line-subtle);
    }
}

@media (max-width: 480px) {
    .saved-plan-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }
    .saved-plan-col-info,
    .saved-plan-col-price,
    .saved-plan-col-tranches,
    .saved-plan-col-stop,
    .saved-plan-col-bands,
    .saved-plan-col-actions {
        grid-column: span 1;
    }
    .saved-plan-col-actions {
        justify-content: stretch;
    }
    .saved-plan-col-actions .button {
        flex: 1;
        justify-content: center;
    }
}

/* A single action color; risk and market data keep their semantic colors. */
#searchHeroBox[hidden],
#btnTabPlans[hidden] {
    display: none !important;
}

.view-mode-tabs {
    align-items: center;
}

.view-mode-btn.active,
.terminal-more-menu[open] > summary,
.terminal-more-menu.is-current > summary {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: none;
}

.saved-plans-count {
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--muted);
    font: 700 10px var(--font-mono);
}

.terminal-more-menu {
    position: relative;
}

.terminal-more-menu > summary {
    list-style: none;
    white-space: nowrap;
}

.terminal-more-menu > summary::-webkit-details-marker {
    display: none;
}

.terminal-more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 30;
    min-width: 190px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .25);
}

.terminal-more-panel .view-mode-btn {
    width: 100%;
    justify-content: flex-start;
}

.quick-more-inline { display: contents; }
.quick-more-button { cursor: pointer; }
.quick-more-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#moreFocusTickersBtn[hidden] { display: none !important; }

.quick-chip {
    color: var(--muted);
}

.watchlist-initial-state,
.analysis-empty-state {
    padding: 32px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
}

.analysis-empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 16px;
}

.top10-header-card {
    background: var(--surface);
    border-color: var(--line);
}

.top10-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top10-refresh-link {
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 600 11px var(--font-sans);
    cursor: pointer;
}

.top10-refresh-link:hover {
    color: var(--text);
    text-decoration: underline;
}

.share-thesis-badge-btn,
.btn-save-plan {
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: none;
}

.share-thesis-badge-btn:hover,
.btn-save-plan:hover {
    background: var(--raised-hover);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: none;
}

.analysis-followup-actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 12px;
}

.analysis-mode-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
}

.analysis-mode-toolbar > span { margin-right: 6px; }
.analysis-mode-toolbar button {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    padding: 8px 14px;
    font: 600 12px var(--font-sans);
    cursor: pointer;
}
.analysis-mode-toolbar button.active,
.analysis-mode-toolbar button:focus-visible {
    color: var(--text);
    border-color: var(--accent);
    outline: 2px solid transparent;
}
.simple-analysis-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.simple-analysis-heading {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}
.simple-analysis-asof { color: var(--muted); font-size: 11px; font-weight: 500; }
.simple-analysis-price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 2px; }
.simple-analysis-price { color: var(--text); font-family: var(--font-mono); font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -0.03em; }
.simple-analysis-change { color: var(--muted); font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.simple-analysis-change.positive { color: var(--green); }
.simple-analysis-change.negative { color: var(--red); }
.simple-analysis-quote-source { color: var(--dim); font-size: 11px; margin: 0 0 18px; }
.news-translation-note { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.simple-analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.simple-analysis-grid > div { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); min-width: 0; }
.simple-analysis-grid h3 { color: var(--text); font-size: 13px; margin: 0 0 8px; }
.simple-analysis-grid p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 10px; overflow-wrap: anywhere; }
.simple-analysis-grid a { color: var(--accent); font-size: 12px; }
.simple-analysis-more { display: inline-flex; align-items: center; gap: 4px; margin: 0 10px 8px 0; padding: 7px 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer; }
.simple-analysis-more:hover, .simple-analysis-more:focus-visible { background: var(--accent); color: var(--bg); }
.simple-analysis-sources { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); }
.simple-analysis-sources h3 { color: var(--text); font-size: 13px; margin: 0 0 10px; }
.simple-analysis-sources ul { list-style: none; margin: 0; padding: 0; }
.simple-analysis-sources li { padding: 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.simple-analysis-sources li:first-child { border-top: 0; }
.simple-analysis-sources a { color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.simple-analysis-sources a:hover, .simple-analysis-sources a:focus-visible { color: var(--accent); text-decoration: underline; }
.simple-analysis-sources small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.simple-analysis-sources p { color: var(--muted); font-size: 12px; margin: 0; }
.simple-analysis-note { color: var(--dim); font-size: 11px; line-height: 1.5; margin: 16px 0 0; }
#mainContentContainer[data-analysis-mode="simple"] #secHeaderAndMatrix,
#mainContentContainer[data-analysis-mode="simple"] #tradingViewContainer,
#mainContentContainer[data-analysis-mode="simple"] #secDetailsAndNews,
#mainContentContainer[data-analysis-mode="advanced"] #simpleAnalysisContainer { display: none !important; }

@media (max-width: 900px) {
    .simple-analysis-grid { grid-template-columns: 1fr; }
    .simple-analysis-card { padding: 16px; }
    .view-mode-tabs {
        display: flex;
        width: 100%;
        gap: 4px;
    }

    .view-mode-tabs > .view-mode-btn,
    .view-mode-tabs > .terminal-more-menu {
        flex: 1 1 0;
        min-width: 0;
    }

    .terminal-more-menu > summary {
        justify-content: center;
    }

    .quick-chips-row {
        flex-wrap: wrap;
        overflow: visible;
    }

    .top10-header-actions {
        width: 100%;
    }

    .top10-header-actions .button.primary {
        flex: 1;
        justify-content: center;
    }

    .top10-title {
        flex-wrap: wrap;
        font-size: 18px;
    }
}
