/* 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: #c5e994;
            --accent-soft: rgba(197, 233, 148, 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: 12px 18px;
            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;
        }

        /* Segmented Language Switcher */
        .segmented-control {
            display: inline-flex;
            background: var(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 2px;
            gap: 2px;
        }
        .seg-btn {
            background: transparent;
            border: none;
            color: var(--muted);
            font-size: 11px;
            font-weight: 600;
            font-family: var(--font-mono);
            padding: 4px 10px;
            border-radius: var(--radius-xs);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .seg-btn.active {
            background: var(--surface);
            color: var(--accent);
            border: 1px solid var(--line);
        }

        /* Search Hero Omnibar */
        .search-hero-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .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: 16px 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;
            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);
        }

        /* 3-Tranche Blueprint Box */
        .tranches-blueprint-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px;
            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: linear-gradient(135deg, #10b981, #06b6d4);
            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(--raised);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 14px 16px;
            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 {
            background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .social-share-btn.btn-threads {
            background: #000000;
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.3);
        }

        .capital-controls-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .capital-preset-chips {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .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); }

        /* TradingView Wrapper */
        .tv-wrapper {
            height: 440px;
            border-radius: var(--radius);
            overflow: hidden;
            border: 1px solid var(--line);
            background: var(--surface);
        }

        /* Carlota Perez Macro Meter */
        .macro-meter-box {
            padding: 16px;
            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: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .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;
        }

        /* Thesis Playbook Box */
        .thesis-playbook-box {
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        /* 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 {
            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-date {
            font-size: 11px;
            color: var(--muted);
            font-family: var(--font-mono);
        }

        .news-article-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.4;
        }

        .news-article-summary-box {
            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;
        }

        .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; }
        }

        @media (max-width: 768px) {
            .masthead {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
            }
            .masthead-controls {
                justify-content: space-between;
                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; }
        }

        @media (max-width: 480px) {
            .quant-matrix-box { grid-template-columns: 1fr; }
            .perez-track { grid-template-columns: 1fr; }
            .masthead-controls { gap: 6px; }
        }

        /* 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;
        }