/* Portfolio page styles extracted from portfolio.html */

        :root { --border: rgba(255, 255, 255, 0.06); --text: var(--text-primary, #e8f0ff); --text2: var(--text-secondary, #8899b0); --muted: var(--text-muted, #556070); --green: #22c55e; --red: #ef4444; --blue: #3b82f6; --orange: #ffaa33; --accent-positive: var(--green); --table-gridline-subtle: rgba(255, 255, 255, 0.08); --table-gridline-medium: rgba(255, 255, 255, 0.14); --table-glow: rgba(255, 255, 255, 0.08); }
        body { font-family: var(--font-body); font-size: var(--text-base); line-height: 1.55; color: var(--text); }

        /* Hero gold accents — now in shared-nav.css */
        /* body::before and body::after inherited from shared-styles.css (background image) */
        .accent-positive, .positive, .g { color: var(--accent-positive) !important; -webkit-text-fill-color: currentColor !important; background: none !important; }
        .accent-negative, .negative, .r { color: var(--accent-negative, #ef4444) !important; -webkit-text-fill-color: currentColor !important; background: none !important; }
        /* Match nav width */
        .container { max-width: 2000px; width: 100%; margin: 0 auto; padding: 60px var(--container-padding, 2rem); }
        /* Hero — push stats to the right */
        .page-hero-top { justify-content: space-between; }
        .paper-money-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-md); font-weight: 200; letter-spacing: 0.1em; color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.25); padding: 6px 12px; border-radius: 20px; margin-bottom: 16px; }
        /* KPI Strip — all metrics in one compact row */
        .kpi-strip {
            display: flex;
            align-items: stretch;
            justify-content: center;
            gap: 10px;
            padding: 14px 0;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .kpi-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            min-width: 80px;
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--border-subtle);
            border-radius: 14px;
            padding: 10px 16px;
            transition: all 0.3s ease;
        }
        .kpi-item:hover {
            background: rgba(255,255,255,0.06);
            border-color: rgba(255,255,255,0.12);
            transform: translateY(-2px);
        }
        .kpi-val {
            font-family: var(--font-number);
            font-size: var(--text-md);
            font-weight: 200;
            color: var(--text2);
        }
        .kpi-item.primary .kpi-val {
            font-size: var(--text-lg);
            font-weight: 200;
            color: var(--text);
        }
        .kpi-lbl {
            font-size: var(--text-xs);
            color: var(--muted);
            letter-spacing: 0.04em;
            white-space: nowrap;
        }
        .kpi-sep {
            display: none;
        }
        @media (max-width: 768px) {
            .kpi-strip { gap: 12px 20px; }
            .kpi-item.primary .kpi-val { font-size: var(--text-md); }
            .kpi-val { font-size: var(--text-md); }
            .kpi-sep { display: none; }
        }
        @media (max-width: 480px) {
            .kpi-strip { gap: 8px 14px; }
            .kpi-item.primary .kpi-val { font-size: var(--text-base); }
            .kpi-val { font-size: var(--text-md); }
        }
        /* Section styling - glass morphism matching insight cards */
        .section {
            margin-bottom: 28px;
            padding: 22px 24px;
            border: 1px solid rgba(212, 175, 55, 0.1);
            border-radius: var(--radius-lg);
            position: relative;
            background: rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }
        .section::after {
            content: '';
            position: absolute;
            bottom: -20px;
            left: 10%;
            right: 10%;
            height: 60px;
            border-radius: 50%;
            filter: blur(30px);
            opacity: 0.7;
            pointer-events: none;
            background: rgba(212, 175, 55, 0.06);
            transition: opacity 0.4s ease;
        }
        .section:hover {
            border-color: rgba(212, 175, 55, 0.18);
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 30px rgba(212, 175, 55, 0.06);
        }
        .section:hover::after { opacity: 0.4; }
        .summary-inline {
            background: transparent;
            border: none;
        }
        .two-col-layout,
        .two-col-equal {
            background: transparent;
        }
        .two-col-layout .section,
        .two-col-equal .section {
            background: rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(212, 175, 55, 0.1);
            border-radius: var(--radius-lg);
            padding: 22px 24px;
        }
        .section-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 200; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
        .section-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
        .section-header-row .section-title { margin-bottom: 0; }
        .section-header-row .chart-controls { margin-bottom: 0; }
        .performance-title { margin-top: 0; }
        .badge { font-family: var(--font-number); font-size: var(--text-md); font-weight: 200; border: 1px solid rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 20px; color: var(--text2); }
        .chart-loading { display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: var(--text-base); flex-direction: column; gap: 12px; margin-top: 8px; animation: pfPulse 2s ease-in-out infinite; }
        #returnsBarChart {
            display: block;
            width: 100% !important;
        }
        #equityChart {
            display: block;
            width: 100% !important;
            height: 400px !important;
            max-height: 400px;
        }
        .charts-stacked { display: flex; flex-direction: column; }
        .charts-stacked .chart-legend { margin-bottom: 0; }
        .charts-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 14px 0; }
        .returns-title { font-size: var(--text-base) !important; }
        #returnsBarChart { height: 300px !important; max-height: 300px; }
        .chart-legend { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
        .chart-legend-compact { margin-top: 8px; }
        .legend-item { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text2); }
        .legend-dot { width: 12px; height: 12px; border-radius: 3px; }
        .legend-dot.entry-dot { border: 2px solid var(--muted); width: 10px; height: 10px; border-radius: 50%; }
        .legend-dot.exit-dot { border-radius: 50%; }
        .chart-controls { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
        .chart-btn { font-family: var(--font-display); font-size: var(--text-base); font-weight: 200; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: var(--text2); cursor: pointer; transition: all 0.2s ease; background: rgba(255,255,255,0.03); }
        .chart-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text); background: rgba(255,255,255,0.06); }
        .chart-btn.active { color: #fff; border-color: rgba(212,175,55,0.35); background: rgba(212,175,55,0.1); font-weight: 200; }
        .equity-section-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }
        .equity-section-top .section-header-row { flex: 1; }
        .equity-kpi-glass {
            flex-shrink: 0;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: var(--radius-lg);
            padding: 10px 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            box-shadow: 0 0 20px rgba(255,255,255,0.06), 0 0 40px rgba(255,255,255,0.03);
        }
        .equity-kpi-value {
            font-family: 'DM Sans', sans-serif;
            font-size: var(--text-xl);
            font-weight: 200;
            line-height: 1;
        }
        .chart-toggle { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); color: var(--text2); }
        .chart-toggle input { accent-color: #555; }
        .period-btn { font-family: var(--font-display); font-size: var(--text-base); font-weight: 200; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: var(--text2); cursor: pointer; transition: all 0.2s ease; background: rgba(255,255,255,0.03); }
        .period-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text); background: rgba(255,255,255,0.06); }
        .period-btn.active { color: #fff; border-color: rgba(212,175,55,0.35); background: rgba(212,175,55,0.1); font-weight: 200; }
        .g { color: var(--green); } .r { color: var(--red); }
        .text-right, .watchlist-table th.text-right, .watchlist-table td.text-right { text-align: right; }
        .text-center, .watchlist-table th.text-center, .watchlist-table td.text-center { text-align: center; }
        .trade-header { display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--table-gridline-subtle); font-size: var(--text-md); letter-spacing: 0.1em; color: var(--muted); font-weight: 200; position: sticky; top: 0; z-index: 1; background: transparent; }
        .trade-header span { display: inline-block; }
        .trade-row { display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--table-gridline-subtle); font-size: var(--text-md); font-family: 'DM Sans', sans-serif; font-weight: 200; border-left: 3px solid transparent; transition: background-color 0.22s ease, transform 0.18s ease; }
        .trade-row:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
        .trade-row:hover { background: rgba(255, 255, 255, 0.04); transform: translateX(2px); }
        .trade-row.profit { border-left-color: var(--accent-green, #22c55e); }
        .trade-row.loss { border-left-color: var(--accent-red, #ef4444); }
        .trade-row.buy-row { border-left-color: var(--accent-green, #22c55e); }
        .trade-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; }
        .trade-date { width: 120px; color: var(--text2); font-family: 'DM Sans', sans-serif; font-weight: 200; }
        .trade-action { display: none; }
        .trade-ticker { width: 140px; font-weight: 200; transition: color 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .trade-ticker:hover { color: var(--text2); }
        .trade-shares { width: 55px; text-align: right; color: var(--text2); font-family: 'DM Sans', sans-serif; font-weight: 200; }
        .trade-price { width: 85px; text-align: right; font-family: 'DM Sans', sans-serif; font-weight: 200; }
        .trade-value { width: 95px; text-align: right; font-weight: 200; font-family: 'DM Sans', sans-serif; }
        .trade-return { width: 75px; text-align: right; font-weight: 200; font-family: 'DM Sans', sans-serif; font-size: var(--text-md); }
        .trade-pnl { width: 90px; text-align: right; font-weight: 200; font-family: 'DM Sans', sans-serif; font-size: var(--text-md); }
        .trade-reason { flex: 1; color: var(--muted); font-size: var(--text-md); }
        .year-header { font-family: 'DM Sans', sans-serif; font-size: var(--text-md); font-weight: 200; color: var(--text2); padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; margin-top: 24px; display: flex; justify-content: space-between; cursor: pointer; border: 1px solid rgba(212, 175, 55, 0.05); background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
        .year-trades { display: none; border: none; border-radius: var(--radius-lg); overflow: hidden; background: transparent; position: relative; }
        .year-trades.expanded { display: block; }
        .year-trades.paywalled .trade-row { filter: blur(6px); pointer-events: none; user-select: none; }
        .trade-paywall-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.25);
            backdrop-filter: blur(2px);
            z-index: 5;
        }
        .trade-paywall-content {
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--muted);
            font-size: var(--text-md);
        }
        .trade-paywall-content svg { color: var(--muted); flex-shrink: 0; }
        .trade-paywall-btn {
            padding: 6px 16px;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.3);
            color: var(--text2);
            font-family: var(--font-body);
            font-size: var(--text-base);
            font-weight: 200;
            text-decoration: none;
            letter-spacing: 0.06em;
            transition: border-color 0.2s, background 0.2s;
        }
        .trade-paywall-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.25);
        }
        .footer-note { text-align: center; padding: 32px; color: var(--muted); font-size: var(--text-base); }
        .data-updated-at { text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.35); margin-top: -4px; margin-bottom: 8px; letter-spacing: 0.03em; }
        .summary-inline-spaced { margin-bottom: 12px; }
        .latest-trades-list { display: flex; flex-direction: column; gap: 8px; }
        .latest-trade-loading { font-size: var(--text-md); padding: 12px; grid-row: 1 / -1; display: flex; align-items: center; animation: pfPulse 2s ease-in-out infinite; }
        .loading-progress { font-size: var(--text-base); }
        .table-scroll-x { overflow-x: auto; }
        .trades-scroll { max-height: 2000px; overflow-y: auto; border: none; border-radius: var(--radius-lg); background: transparent; }
        .footer-note-disclaimer { margin-top: 8px; }
        .ml-8 { margin-left: 8px; }
        .watchlist-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
        .watchlist-stock-name { font-weight: 200; color: #fff; }
        .watchlist-stock-ticker { color: var(--muted); font-size: var(--text-xs); font-weight: 200; font-family: var(--font-number); }
        .portfolio-logo-fallback { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--text-md); font-weight: 200; color: var(--text2); background: #fff; }
        .latest-trade-icon-fallback { font-size: var(--text-base); font-weight: 200; color: var(--text2); }
        .trade-col-logo { width: 28px; }
        .trade-col-date { width: 120px; }
        .trade-col-type { display: none; }
        .trade-col-ticker { width: 140px; }
        .trade-col-shares { width: 55px; text-align: right; }
        .trade-col-price { width: 85px; text-align: right; }
        .trade-col-value { width: 95px; text-align: right; }
        .trade-col-return { width: 75px; text-align: right; }
        .trade-col-pnl { width: 90px; text-align: right; }
        .trade-col-reason { flex: 1; }
        .trade-muted { color: var(--muted); }
        .trade-ticker-link { text-decoration: none; color: inherit; }
        .loading-overlay-message { text-align: center; }
        .loading-overlay-sub { font-size: var(--text-base); color: var(--muted); margin-top: 8px; }
        .loading-overlay-error { text-align: center; color: var(--red); }
        .maxdd-subtext { font-size: var(--text-base); color: var(--muted); }
        #maxDrawdownLabel { line-height: 1.2; }
        #maxDrawdownLabel br { display: none; }
        #maxDrawdownLabel span { display: none; }
        .live-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'DM Sans', sans-serif; font-size: var(--text-base); font-weight: 200; letter-spacing: 0.1em; color: var(--muted); margin-left: 8px; }
        .live-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s infinite; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        /* Focus-visible for interactive elements */
        .chart-btn:focus-visible,
        .period-btn:focus-visible,
        .filter-btn:focus-visible,
        .trade-paywall-btn:focus-visible,
        .mv-stock-btn:focus-visible,
        .mv-watchlist-link:focus-visible,
        .trade-ticker-link:focus-visible,
        .watchlist-link:focus-visible { outline: 2px solid rgba(212, 175, 55, 0.7); outline-offset: 2px; }

        @media (max-width: 768px) {
            .summary-grid { grid-template-columns: repeat(2, 1fr); }
            #returnsBarChart { height: 160px !important; max-height: 160px; }
            #equityChart { height: 280px !important; max-height: 280px; }
            .trade-reason { display: none; }
            .trade-pnl { display: none; }
        }
        .watchlist-table { width: 100%; border-collapse: collapse; }
        .watchlist-table th, .watchlist-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--table-gridline-subtle); vertical-align: middle; }
        .watchlist-table th { font-size: var(--text-md); letter-spacing: 0.1em; color: var(--muted); font-weight: 200; }
        .watchlist-table td { font-size: var(--text-md); vertical-align: middle; font-family: var(--font-number); font-weight: 200; }
        .watchlist-table .y { color: var(--muted); }
        .watchlist-table tbody tr { transition: background-color 0.22s ease, transform 0.18s ease; }
        .watchlist-table tr:hover { background: rgba(255,255,255,0.03); transform: translateX(2px); }
        .watchlist-table .stock-cell { font-weight: 200; white-space: nowrap; }
        .watchlist-table .stock-cell a:hover .stock-name { color: var(--text2); }
        .watchlist-table .stock-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: contain; }
        .watchlist-table .thesis-cell { color: var(--text2); max-width: 480px; }
        .watchlist-table .verdict-cell { padding: 10px 16px; }
        .verdict { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: var(--text-md); font-weight: 200; font-family: 'DM Sans', var(--font-number); letter-spacing: 0.02em; white-space: nowrap; }
        .verdict.very-attractive { background: rgba(0, 200, 120, 0.12); color: #00d68f; }
        .verdict.attractive { background: rgba(0, 200, 120, 0.08); color: #4ecb71; }
        .verdict.neutral { background: rgba(0, 0, 0, 0.25); color: var(--text2); }
        .verdict.momentum { background: rgba(100, 150, 255, 0.1); color: #7eb3ff; }
        .verdict.caution { background: rgba(255, 180, 50, 0.1); color: #f0b040; }
        .verdict.stretched { background: rgba(255, 80, 80, 0.1); color: #ff6b6b; }
        .strategy-section .section-title { margin-bottom: 8px; }
        .strategy-visual-grid {
            display: flex;
            gap: 6px;
        }
        .strategy-visual-card {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 8px 6px 6px;
            border: 1px solid rgba(212, 175, 55, 0.08);
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.25);
            transition: all 0.3s ease;
            min-width: 0;
        }
        .strategy-visual-card:hover {
            border-color: rgba(212, 175, 55, 0.12);
            background: rgba(0, 0, 0, 0.25);
        }
        .strategy-visual-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 6px;
            flex-shrink: 0;
        }
        .strategy-visual-card:nth-child(1) .strategy-visual-icon {
            background: rgba(212, 175, 55, 0.12);
            color: rgba(212, 175, 55, 0.75);
        }
        .strategy-visual-card:nth-child(2) .strategy-visual-icon {
            background: rgba(212, 175, 55, 0.08);
            color: rgba(212, 175, 55, 0.6);
        }
        .strategy-visual-card:nth-child(3) .strategy-visual-icon {
            background: rgba(212, 175, 55, 0.1);
            color: rgba(212, 175, 55, 0.65);
        }
        .strategy-visual-icon svg {
            width: 18px;
            height: 18px;
        }
        .strategy-visual-stat {
            font-family: var(--font-number);
            font-size: var(--text-lg);
            font-weight: 200;
            color: var(--text);
            margin-bottom: 1px;
        }
        .strategy-visual-title {
            font-size: var(--text-xs);
            letter-spacing: 0.1em;
            color: var(--muted);
            margin-bottom: 3px;
        }
        .strategy-visual-desc {
            font-size: var(--text-xs);
            color: var(--text2);
            line-height: 1.3;
        }
        @media (max-width: 600px) {
            .strategy-visual-grid { flex-direction: column; }
        }
        .market-view-inline {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid rgba(255,255,255,0.06);
        }
        .market-view-date {
            font-size: var(--text-xs);
            color: var(--muted);
            margin-bottom: 10px;
        }
        .market-view-bullets {
            margin-bottom: 0;
        }
        .mv-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        .mv-list li {
            font-size: var(--text-md);
            color: var(--text2);
            line-height: 1.7;
            padding-left: 0;
        }
        .mv-list li strong {
            color: var(--text);
            font-weight: 200;
        }
        .mv-inline-ticker {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px 2px 3px;
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.04);
            text-decoration: none;
            color: var(--text);
            font-size: var(--text-xs);
            font-weight: 200;
            vertical-align: middle;
            margin: 0 2px;
            transition: all 0.2s ease;
        }
        .mv-inline-ticker:hover {
            border-color: rgba(212,175,55,0.25);
            background: rgba(212,175,55,0.06);
        }
        .mv-inline-ticker img {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            object-fit: contain;
        }
        .mv-fallback {
            font-size: var(--text-md);
            color: var(--text2);
            line-height: 1.6;
        }
        .market-view-news {
            padding-top: 14px;
            border-top: 1px solid rgba(212, 175, 55, 0.08);
            margin-top: 14px;
        }
        .market-view-news:empty {
            display: none;
        }
        .mv-news-label {
            font-size: var(--text-base);
            font-weight: 200;
            letter-spacing: 0.08em;
            color: rgba(212, 175, 55, 0.7);
            margin-bottom: 8px;
        }
        .mv-stock-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .mv-stock-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 14px 6px 6px;
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.25);
            text-decoration: none;
            color: var(--text);
            font-size: var(--text-md);
            font-weight: 200;
            transition: all 0.2s ease;
        }
        .mv-stock-btn:hover {
            border-color: rgba(212, 175, 55, 0.25);
            background: rgba(212, 175, 55, 0.06);
        }
        .mv-stock-btn img {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            object-fit: contain;
        }
        .mv-watchlist-link {
            display: inline-block;
            margin-top: 10px;
            font-size: var(--text-md);
            color: rgba(212, 175, 55, 0.7);
            text-decoration: none;
            font-weight: 200;
            transition: color 0.2s ease;
        }
        .mv-watchlist-link:hover {
            color: rgba(212, 175, 55, 0.85);
        }
        .two-col-layout { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; width: 100%; align-items: stretch; }
        .two-col-layout .section { margin-bottom: 0; width: 100%; }
        .two-col-layout .section:first-child { padding: 20px; }
        .two-col-layout .section:first-child .section-title { font-size: var(--text-md); margin-bottom: 10px; }

        /* Equity curve — full width */
        .charts-fullwidth {
            width: 100%;
            margin-bottom: 20px;
        }

        /* Main Layout - Full Width */
        .main-layout {
            display: flex;
            flex-direction: column;
            gap: 24px;
            width: 100%;
        }
        .main-content-area {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        .main-content-area .section {
            margin-bottom: 0;
            width: 100%;
        }
        .two-col-equal {
            display: grid;
            grid-template-columns: 1fr 1.2fr;
            gap: 20px;
            width: 100%;
            margin-bottom: 20px;
            align-items: stretch;
        }
        .two-col-equal .section {
            width: 100%;
            margin-bottom: 0;
            min-height: 0;
        }
        .section.glass-box {
            width: 100%;
        }

        .holdings-layout { display: flex; gap: 0; align-items: center; }
        .holdings-left { flex: 1; position: relative; min-width: 0; overflow: hidden; }
        .holdings-left canvas { display: block; margin: 0 auto; }
        .holdings-right { flex: 0.4; }
        #donutChart { width: 100% !important; height: auto !important; max-width: 420px; }
        .donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
        .donut-center-value { font-family: var(--font-number); font-size: var(--text-xl); font-weight: 200; }
        .donut-center-label { font-size: var(--text-base); color: var(--muted); }
        .holding-hint { font-size: var(--text-base); color: var(--muted); text-align: center; margin-top: 4px; }
        .holding-detail { padding: 12px; border-radius: var(--radius-lg); display: none; }
        .holding-detail.active { display: block; }
        .holding-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
        .holding-detail-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; }
        .holding-detail-name { font-size: var(--text-md); font-weight: 200; }
        .holding-detail-ticker { font-size: var(--text-md); color: var(--text2); }
        .holding-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .holding-detail-label { font-size: var(--text-md); color: var(--text2); }
        .holding-detail-value { font-family: var(--font-number); font-size: var(--text-lg); font-weight: 200; color: var(--text); }
        .trade-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
        .filter-btn { font-family: var(--font-display); font-size: var(--text-md); font-weight: 200; padding: 7px 12px; border: 1px solid rgba(212, 175, 55, 0.08); border-radius: 6px; color: var(--text2); cursor: pointer; background: rgba(255,255,255,0.02); transition: all 0.2s ease; }
        .filter-btn:hover { border-color: rgba(212, 175, 55, 0.15); color: var(--text); }
        .filter-btn.active { border-color: rgba(212, 175, 55, 0.4); color: rgba(212, 175, 55, 0.85); background: rgba(212, 175, 55, 0.06); }
        .latest-trade-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border: 1px solid rgba(212, 175, 55, 0.08); border-radius: 10px; border-left: 3px solid transparent; transition: all 0.2s ease; background: rgba(0, 0, 0, 0.25); }
        .latest-trade-card.buy { border-left-color: var(--green); }
        .latest-trade-card.sell { border-left-color: var(--red); }
        .latest-trade-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
        .latest-trade-icon img { width: 100%; height: 100%; object-fit: cover; }
        .latest-trade-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .latest-trade-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
        .latest-trade-name { font-family: var(--font-body); font-weight: 200; font-size: var(--text-md); line-height: 1.2; color: var(--text); }
        .latest-trade-ticker { font-size: var(--text-xs); color: var(--muted); font-family: var(--font-number); font-weight: 200; }
        .latest-trade-action { display: none; }
        .trade-shares.buy { color: var(--green); font-weight: 200; }
        .trade-shares.sell { color: var(--red); font-weight: 200; }
        .latest-trade-details { font-size: var(--text-md); color: var(--text2); margin-bottom: 2px; line-height: 1.2; }
        .latest-trade-reason { font-size: var(--text-md); color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        @media (max-width: 900px) { .two-col-equal { grid-template-columns: 1fr !important; } }
        @media (max-width: 600px) { .latest-trade-reason { display: none; } .latest-trade-card { padding: 10px 12px; } .holding-detail-grid { grid-template-columns: 1fr; } .chart-legend { flex-direction: column; gap: 8px; align-items: flex-start; } #equityChart { height: 280px !important; } }
        @media (max-width: 480px) { .holdings-layout { flex-direction: column; } .holdings-left { flex: none; width: 100%; } .holdings-right { flex: none; width: 100%; } #donutChart { max-width: 200px; } .section { padding: 16px !important; } #returnsBarChart { height: 130px !important; } #equityChart { height: 200px !important; } }

        /* Holding detail fundamentals */
        .holding-detail-fundamentals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); }
        .fund-metric { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; background: rgba(255,255,255,0.03); border-radius: 6px; border: 1px solid rgba(255,255,255,0.05); }
        .fund-label { font-size: var(--text-xs); color: var(--muted); font-weight: 200; }
        .fund-value { font-family: var(--font-number); font-size: var(--text-md); font-weight: 200; color: var(--text); }
        /* Watchlist metric columns */
        .watchlist-table .r { text-align: right; font-family: var(--font-number); font-size: var(--text-md); font-weight: 200; white-space: nowrap; }
        .watchlist-table .c { text-align: center; font-family: var(--font-number); font-size: var(--text-md); font-weight: 200; }

        /* ========================================== */
        /* CORRELATION MATRIX                         */
        /* ========================================== */
        .correlation-header {
            margin-bottom: 16px;
        }
        .correlation-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
        }
        .correlation-subtitle {
            font-size: var(--text-xs);
            color: var(--muted);
            margin-top: 4px;
        }
        .correlation-loading {
            text-align: center;
            color: var(--text2);
            font-size: var(--text-md);
            padding: 24px 0;
            animation: pfPulse 2s ease-in-out infinite;
        }
        .correlation-empty {
            text-align: center;
            color: var(--muted);
            font-size: var(--text-md);
            padding: 24px 0;
        }

        /* Diversification Score Box */
        .diversification-score-box {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 16px;
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        .diversification-score-value {
            font-family: var(--font-number);
            font-size: var(--text-lg);
            font-weight: 200;
        }
        .diversification-score-value.diversification-good { color: var(--green); }
        .diversification-score-value.diversification-moderate { color: var(--orange); }
        .diversification-score-value.diversification-concentrated { color: var(--red); }
        .diversification-score-label {
            font-size: var(--text-xs);
            font-weight: 200;
        }
        .diversification-score-label.diversification-good { color: var(--green); }
        .diversification-score-label.diversification-moderate { color: var(--orange); }
        .diversification-score-label.diversification-concentrated { color: var(--red); }
        .diversification-bar {
            width: 60px;
            height: 4px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.08);
            position: relative;
            overflow: hidden;
        }
        .diversification-bar::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: var(--bar-pct, 50%);
            border-radius: 2px;
            transition: width 0.6s ease;
        }
        .diversification-bar.diversification-good::after { background: var(--green); }
        .diversification-bar.diversification-moderate::after { background: var(--orange); }
        .diversification-bar.diversification-concentrated::after { background: var(--red); }

        /* Heatmap Table */
        .heatmap-scroll {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .heatmap-table {
            border-collapse: separate;
            border-spacing: 2px;
            width: 100%;
            min-width: fit-content;
        }
        .heatmap-table th,
        .heatmap-table td {
            font-family: var(--font-number);
            font-weight: 200;
            text-align: center;
            padding: 0;
        }
        .heatmap-table thead th {
            font-size: var(--text-base);
            font-weight: 200;
            color: var(--text2);
            padding: 6px 4px;
            letter-spacing: 0.02em;
            position: sticky;
            top: 0;
            z-index: 1;
        }
        .heatmap-ticker-col {
            writing-mode: vertical-lr;
            transform: rotate(180deg);
            white-space: nowrap;
            height: 52px;
            vertical-align: bottom !important;
        }
        .heatmap-ticker-row {
            font-size: var(--text-xs);
            font-weight: 200;
            color: var(--text2);
            text-align: right !important;
            padding-right: 8px !important;
            white-space: nowrap;
        }
        .heatmap-cell {
            width: 42px;
            height: 36px;
            font-size: var(--text-base);
            font-weight: 200;
            color: rgba(255, 255, 255, 0.7);
            border-radius: 4px;
            cursor: default;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            position: relative;
        }
        .heatmap-cell:not(.heatmap-diag):hover {
            transform: scale(1.15);
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
            z-index: 2;
            cursor: pointer;
        }
        .heatmap-diag {
            background: rgba(255, 255, 255, 0.02) !important;
            color: transparent;
        }
        .heatmap-diag::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.15);
            transform: translate(-50%, -50%);
        }

        /* Tooltip */
        .correlation-tooltip {
            display: none;
            position: absolute;
            z-index: 100;
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            padding: 10px 14px;
            font-size: var(--text-md);
            color: var(--text);
            pointer-events: none;
            transform: translate(-50%, -100%);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            white-space: nowrap;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            font-family: var(--font-number);
            font-weight: 200;
            line-height: 1.5;
        }
        .tooltip-value {
            font-size: var(--text-md);
            font-weight: 200;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .correlation-title-row {
                flex-direction: column;
                align-items: flex-start;
            }
            .heatmap-cell {
                width: 34px;
                height: 30px;
                font-size: var(--text-base);
            }
            .heatmap-ticker-col {
                height: 40px;
            }
            .diversification-score-box {
                width: 100%;
                justify-content: center;
            }
        }
        @media (max-width: 480px) {
            .heatmap-cell {
                width: 28px;
                height: 26px;
                font-size: var(--text-base);
            }
            .heatmap-ticker-row {
                font-size: var(--text-base);
            }
            .heatmap-ticker-col {
                font-size: var(--text-base) !important;
                height: 36px;
            }
        }

/* KPI skeleton shimmer */
.kpi-skeleton {
    display: inline-block;
    width: 48px;
    height: 1.1em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    vertical-align: middle;
}

.kpi-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
    animation: kpiShimmer 1.8s ease-in-out infinite;
}

@keyframes kpiShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pfPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
    .kpi-skeleton::after { animation: none; }
    .portfolio-pulse-shimmer .shimmer-line::after { animation: none; }
}

/* Portfolio AI Pulse card */
.portfolio-pulse-card {
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.portfolio-pulse-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.portfolio-pulse-icon {
    font-size: 16px;
    color: #a855f7;
}

.portfolio-pulse-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: #a855f7;
    letter-spacing: 0.03em;
}

.portfolio-pulse-text {
    font-size: var(--text-sm);
    font-weight: 200;
    line-height: 1.65;
    color: rgba(232, 240, 255, 0.88);
}

.portfolio-pulse-text strong {
    font-weight: 500;
    color: #e8f0ff;
}

.portfolio-pulse-shimmer .shimmer-line {
    height: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.portfolio-pulse-shimmer .shimmer-line.short {
    width: 60%;
}

.portfolio-pulse-shimmer .shimmer-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.08) 50%, transparent 100%);
    animation: kpiShimmer 1.8s ease-in-out infinite;
}

/* --- Per-holding Sparkline --- */
.holding-sparkline-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.holding-sparkline-label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
#detailSparkline {
    width: 100%;
    height: 60px;
    display: block;
}

/* --- P&L Breakdown --- */
.pnl-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.pnl-item {
    background: rgba(18,24,38,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(12px);
}
.pnl-item-label {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.pnl-item-value {
    font-size: 22px;
    font-weight: 200;
    line-height: 1.2;
}
.pnl-item-pct {
    font-size: 12px;
    margin-top: 2px;
}
.pnl-bar-wrap {
    height: 3px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.pnl-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}
@media (max-width: 768px) {
    .pnl-breakdown-grid { grid-template-columns: 1fr; }
}

/* === Benchmark Selector === */
.benchmark-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    font-family: inherit;
    font-size: var(--text-sm, 0.875rem);
    font-weight: 400;
    padding: 2px 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.5)' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 22px;
    transition: border-color 0.2s;
}
.benchmark-select:hover {
    border-color: rgba(255,255,255,0.25);
}
.benchmark-select option {
    background: #1a1f2e;
    color: rgba(255,255,255,0.9);
}

