/* Portfolio Explorer (All Sectors): the feature's stylesheet. Every rule is prefixed
   with .pa-root (the host element AxeraPortfolioAll.mount() is given) so it cannot
   reach the page that hosts the feature, and the host page's own rules are scoped
   the same way (docs/portfolio-all.md, "Embedding"). The host is sized by the
   page; the fullscreen panels fill the host, so the page's own controls stay reachable. */
:where(.pa-root) * { margin: 0; padding: 0; box-sizing: border-box; }
.pa-root { position: relative; isolation: isolate; font-family: 'Manrope', sans-serif; background: #1e1e1e; color: #e0e0e0; font-weight: 300; line-height: 1.4; overflow: hidden; height: 100%; }
.pa-root ::-webkit-scrollbar { width: 6px; height: 6px; }
.pa-root ::-webkit-scrollbar-track { background: transparent; }
.pa-root ::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.pa-root ::-webkit-scrollbar-thumb:hover { background: #555; }
.pa-root ::-webkit-scrollbar-corner { background: transparent; }
:where(.pa-root) * { scrollbar-width: thin; scrollbar-color: #444 transparent; }
.pa-root .container { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 0; }
.pa-root .top-bar {
            display: flex; align-items: center; gap: 16px;
            padding: 12px 16px; background: #252525; border-bottom: 1px solid #333;
            flex-shrink: 0;
        }
.pa-root .top-title { font-size: 18px; font-weight: 300; color: #fff; white-space: nowrap; }
.pa-root .selector-dropdown {
            width: 240px; padding: 6px 10px; background: #1e1e1e; border: 1px solid #444;
            border-radius: 4px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 12px;
            outline: none; cursor: pointer;
        }
.pa-root .selector-dropdown:focus { border-color: #6b9bd1; }
.pa-root .portfolio-picker { position: relative; }
.pa-root .portfolio-picker-trigger {
            width: 280px; padding: 6px 10px; background: #1e1e1e; border: 1px solid #444;
            border-radius: 4px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 12px;
            cursor: pointer; display: flex; align-items: center; justify-content: space-between;
            white-space: nowrap; overflow: hidden;
        }
.pa-root .portfolio-picker-trigger:hover { border-color: #666; }
.pa-root .picker-arrow { color: #888; font-size: 10px; margin-left: 8px; flex-shrink: 0; }
.pa-root .portfolio-picker-dropdown {
            display: none; position: absolute; top: 100%; left: 0; z-index: 100;
            background: #252525; border: 1px solid #444; border-radius: 6px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.6); margin-top: 4px;
            min-width: 820px;
        }
.pa-root .portfolio-picker-dropdown.open { display: block; }
.pa-root .picker-search {
            padding: 8px; border-bottom: 1px solid #333;
        }
.pa-root .picker-search input {
            width: 100%; padding: 6px 10px; background: #1e1e1e; border: 1px solid #444;
            border-radius: 4px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 12px;
            outline: none;
        }
.pa-root .picker-search input:focus { border-color: #6b9bd1; }
.pa-root .picker-columns {
            display: flex; gap: 0; max-height: 400px; overflow-y: auto;
        }
.pa-root .picker-column {
            flex: 1; min-width: 0; border-right: 1px solid #333;
        }
.pa-root .picker-column:last-child { border-right: none; }
.pa-root .picker-column-title {
            padding: 8px 12px; font-size: 10px; font-weight: 600; color: #888;
            text-transform: uppercase; letter-spacing: 0.5px; background: #2a2a2a;
            border-bottom: 1px solid #333; position: sticky; top: 0; z-index: 1;
        }
.pa-root .picker-item {
            padding: 6px 12px; font-size: 12px; color: #ccc; cursor: pointer;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
.pa-root .picker-item:hover { background: #333; color: #fff; }
.pa-root .picker-item.active { background: #3a4a5a; color: #6b9bd1; }
.pa-root .picker-factor-toggle {
            display: flex; gap: 4px; padding: 8px 12px 6px; border-bottom: 1px solid #2a2a2a;
        }
.pa-root .picker-factor-toggle button {
            flex: 1; padding: 4px 8px; font-size: 10px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer;
            background: #1e1e1e; color: #888; border: 1px solid #333; border-radius: 3px;
            font-family: inherit;
        }
.pa-root .picker-factor-toggle button:hover { color: #ccc; border-color: #555; }
.pa-root .picker-factor-toggle button.active {
            background: #3a4a5a; color: #6b9bd1; border-color: #6b9bd1;
        }
.pa-root .picker-factor-group {
            padding: 6px 12px 2px; font-size: 9.5px; color: #6b6b6b; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.5px;
        }
.pa-root .picker-factor-item {
            padding: 4px 12px; font-size: 11.5px; color: #ccc; cursor: pointer;
            display: flex; align-items: center; gap: 6px; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis;
        }
.pa-root .picker-factor-item:hover { background: #333; color: #fff; }
.pa-root .picker-factor-item input[type=checkbox] {
            width: 11px; height: 11px; margin: 0; accent-color: #6b9bd1; cursor: pointer;
        }
.pa-root .picker-factor-item.checked { color: #6b9bd1; }
.pa-root .picker-factor-item .fi-count {
            margin-left: auto; color: #666; font-size: 10px; font-variant-numeric: tabular-nums;
        }
.pa-root .picker-factor-apply {
            padding: 6px 12px; border-top: 1px solid #2a2a2a;
            font-size: 11px; color: #888; text-align: right;
        }
.pa-root .picker-factor-apply span { color: #6b9bd1; font-weight: 600; }
.pa-root .picker-factor-apply .clear {
            color: #888; cursor: pointer; margin-right: 8px;
        }
.pa-root .picker-factor-apply .clear:hover { color: #ccc; text-decoration: underline; }
.pa-root .top-actions { display: flex; gap: 8px; margin-left: auto; }
.pa-root .btn {
            padding: 6px 12px; background: #6b9bd1; border: 1px solid transparent; border-radius: 4px;
            color: #fff; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 500;
            cursor: pointer; transition: background 0.2s; line-height: 1.2; box-sizing: border-box;
        }
.pa-root .btn:hover { background: #5a8bc0; }
.pa-root .btn-secondary {
            background: #444; color: #e0e0e0; border-color: transparent;
        }
.pa-root .btn-secondary:hover { background: #555; }
.pa-root .btn-time-machine.active { background: #6b9bd1; color: #fff; }
.pa-root .btn-allocator { background: #6b9bd1; color: #fff; border-color: transparent; }
.pa-root .btn-allocator:hover { background: #5a8ac0; }
.pa-root .btn-allocator.active { background: #6b9bd1; color: #fff; }
.pa-root .alloc-group-row td { background: #2a2a2e !important; border-bottom: 1px solid #444; }
.pa-root .alloc-group-row td:first-child { padding-left: 4px; }
.pa-root .alloc-chevron { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: #aaa; font-size: 12px; user-select: none; transition: transform 0.15s; background: #383838; border-radius: 3px; border: 1px solid #555; }
.pa-root .alloc-chevron:hover { background: #444; color: #fff; border-color: #666; }
.pa-root .alloc-chevron.expanded { transform: rotate(90deg); }
.pa-root .alloc-child-row td:first-child { padding-left: 24px; }
.pa-root .alloc-badge { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.pa-root .alloc-badge-wl { background: #3a4a3a; color: #7bc77b; }
.pa-root .alloc-badge-13f { background: #3a3a4a; color: #7b9bd1; }
.pa-root .alloc-badge-etf { background: #4a3a3a; color: #d19b7b; }
.pa-root .alloc-badge-alloc { background: #4a3a4a; color: #c79bd1; }
.pa-root .alloc-remove { cursor: pointer; color: #666; font-size: 11px; padding: 2px 4px; }
.pa-root .alloc-remove:hover { color: #f06060; }
.pa-root .alloc-weight-input { width: 50px; background: #1e1e1e; border: 1px solid #444; border-radius: 3px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 11px; padding: 2px 4px; text-align: right; outline: none; }
.pa-root .alloc-weight-input:focus { border-color: #6b9bd1; }
.pa-root .alloc-add-row td { color: #666; cursor: pointer; font-size: 12px; }
.pa-root .alloc-add-row:hover td { color: #999; background: #252525; }
.pa-root .btn-book-toggle { background: #6b9bd1; color: #fff; border-color: transparent; }
.pa-root .btn-book-toggle:hover { background: #5a8ac0; }
.pa-root .btn-book-toggle.active { background: #6b9bd1; color: #fff; }
.pa-root .source-badges { display: flex; gap: 2px; overflow: hidden; max-width: 100%; }
.pa-root .source-badge { display: inline-block; padding: 1px 4px; border-radius: 3px; font-size: 8px; font-weight: 600; white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.pa-root .source-badge-wl { background: #3a4a3a; color: #7bc77b; }
.pa-root .source-badge-13f { background: #3a3a4a; color: #7b9bd1; }
.pa-root .source-badge-etf { background: #4a3a3a; color: #d19b7b; }
.pa-root .source-badge-alloc { background: #4a3a4a; color: #c79bd1; }
.pa-root .source-cell { position: relative; cursor: default; }
.pa-root .source-cell:hover .source-tooltip { display: flex; }
.pa-root .source-tooltip { display: none; position: absolute; top: 100%; left: 0; z-index: 50; background: #252525; border: 1px solid #444; border-radius: 4px; padding: 4px 6px; gap: 3px; flex-wrap: wrap; box-shadow: 0 4px 12px rgba(0,0,0,0.5); white-space: nowrap; }
.pa-root .source-tooltip .source-badge { max-width: none; }
.pa-root .fa-docked.fullscreen {
            position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
            width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
            z-index: 9999; border-radius: 0; border: none;
        }
.pa-root .perf-panel.fullscreen {
            position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
            width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
            z-index: 9999; border-radius: 0; border: none;
        }
.pa-root .risk-panel.fullscreen {
            position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
            width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
            z-index: 9999; border-radius: 0; border: none;
        }
.pa-root .tm-date-input {
            width: 100%; padding: 8px 10px; background: #1e1e1e; border: 1px solid #444;
            border-radius: 4px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 12px;
            outline: none;
        }
.pa-root .tm-date-input:focus { border-color: #6b9bd1; }
.pa-root .tm-period-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pa-root .tm-period-btn {
            padding: 5px 12px; background: #333; border: 1px solid #444; border-radius: 4px;
            color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 500;
            cursor: pointer; transition: all 0.15s;
        }
.pa-root .tm-period-btn:hover { background: #444; border-color: #666; }
.pa-root .tm-period-btn.active { background: #6b9bd1; border-color: #6b9bd1; color: #fff; }
.pa-root .spreadsheet-container {
            background: #252525; 
            overflow: hidden; display: flex; flex-direction: column;
            flex: 1; height: 100%;
        }
.pa-root .spreadsheet-header {
            padding: 12px 16px; border-bottom: 1px solid #333;
            display: flex; align-items: center; justify-content: space-between;
            flex-shrink: 0;
        }
.pa-root .spreadsheet-title { font-size: 13px; font-weight: 600; color: #fff; }
.pa-root .spreadsheet-controls {
            display: flex; gap: 8px; align-items: center;
        }
.pa-root .btn-save-view {
            background: #6b9bd1; color: #fff; border-color: transparent;
        }
.pa-root .btn-save-view:hover { background: #5a8ac0; }
.pa-root .save-toast {
            font-size: 11px; color: #6bbd6b; opacity: 0;
            transition: opacity 0.2s; white-space: nowrap; pointer-events: none;
        }
.pa-root .save-toast.show { opacity: 1; }
.pa-root .spreadsheet-table-wrapper {
            overflow-x: auto; overflow-y: auto; 
            flex: 1;
            position: relative;
        }
.pa-root .spreadsheet-table {
            border-collapse: collapse;
            font-size: 12px;
        }
.pa-root .spreadsheet-table th {
            padding: 3px 6px; font-size: 10px; font-weight: 600; color: #999;
            text-transform: uppercase; letter-spacing: 0.3px; text-align: left; white-space: nowrap;
            background: #2a2a2a; border-bottom: 1px solid #333; border-right: 1px solid #333;
            position: sticky; top: 0; z-index: 10;
            user-select: none;
        }
.pa-root .spreadsheet-table th:first-child { position: sticky; left: 0; z-index: 11; background: #2a2a2a; }
.pa-root .spreadsheet-table th.sortable { cursor: pointer; }
.pa-root .spreadsheet-table th.sortable:hover { background: #333; }
.pa-root .spreadsheet-table th.sort-asc::after { content: ' ▲'; font-size: 9px; color: #6b9bd1; }
.pa-root .spreadsheet-table th.sort-desc::after { content: ' ▼'; font-size: 9px; color: #6b9bd1; }
.pa-root .col-resize-handle {
            position: absolute; right: 0; top: 0; bottom: 0; width: 4px;
            cursor: col-resize; background: transparent; z-index: 12;
        }
.pa-root .col-resize-handle:hover { background: #6b9bd1; }
.pa-root .col-resize-handle.resizing { background: #6b9bd1; }
.pa-root .col-remove-btn {
            position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
            background: transparent; border: none; color: #555; cursor: pointer;
            font-size: 11px; padding: 0; width: 14px; height: 14px;
            display: none; align-items: center; justify-content: center;
            border-radius: 2px; z-index: 12;
        }
.pa-root .col-remove-btn:hover { color: #f87171; background: rgba(248,113,113,0.15); }
.pa-root .spreadsheet-table th:hover .col-remove-btn { display: inline-flex; }
.pa-root .spreadsheet-table td {
            padding: 3px 6px; border-bottom: 1px solid #2a2a2a; border-right: 1px solid #2a2a2a; font-size: 12px; white-space: nowrap;
            font-variant-numeric: tabular-nums;
        }
.pa-root .spreadsheet-table td:first-child { position: sticky; left: 0; background: #252525; z-index: 1; }
.pa-root .spreadsheet-table tr:hover td { background: #2d2d2d; }
.pa-root .spreadsheet-table tr:hover td:first-child { background: #2d2d2d; }
.pa-root .spreadsheet-table tbody tr.selected td { background: #3a3a3a; }
.pa-root .spreadsheet-table tbody tr.selected td:first-child { background: #3a3a3a; }
.pa-root .spreadsheet-table tbody tr.total-row td { background: #2a2a2a; border-top: 1px solid #444; }
.pa-root .spreadsheet-table tbody tr.total-row td.empty-cell { background: #1e1e1e; border-top: none; }
.pa-root .spreadsheet-table tbody tr.empty-row td {
            background: #1e1e1e; border: 1px dashed #444;
            color: #555; font-style: italic;
        }
.pa-root .spreadsheet-table tbody tr.empty-row:hover td {
            background: #252525; border-color: #666;
        }
.pa-root .spreadsheet-table th.empty-col {
            background: #1e1e1e; border-bottom: 1px solid #333; border-right: 1px dashed #444;
            color: #555; font-style: italic; min-width: 100px;
        }
.pa-root .spreadsheet-table th.empty-col:hover {
            background: #252525; border-color: #666;
        }
.pa-root .spreadsheet-table td.empty-cell {
            background: #1e1e1e; border: 1px dashed #444;
            min-width: 100px; padding: 3px 6px;
        }
.pa-root .spreadsheet-table td.empty-cell.ticker-cell {
            cursor: text; padding: 3px 6px;
        }
.pa-root .spreadsheet-table td.empty-cell.ticker-cell:hover {
            background: #2a2a2a; border-color: #666;
        }
.pa-root .ticker-input-inline {
            width: 100%; background: transparent; border: 1px solid #6b9bd1;
            color: #fff; font-family: 'Manrope', sans-serif; font-size: 12px;
            padding: 2px 4px; outline: none; border-radius: 2px;
            font-weight: 500;
        }
.pa-root .ticker-search-wrapper {
            position: relative;
        }
.pa-root .ticker-search-dropdown {
            position: absolute; top: 100%; left: 0;
            width: 280px; max-height: 220px; overflow-y: auto;
            background: #252525; border: 1px solid #444; border-top: none;
            border-radius: 0 0 6px 6px; z-index: 200;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
        }
.pa-root .ticker-search-item {
            padding: 5px 8px; cursor: pointer; display: flex; align-items: center; gap: 8px;
            border-bottom: 1px solid #2a2a2a; font-size: 12px;
        }
.pa-root .ticker-search-item:hover, .pa-root .ticker-search-item.highlighted { background: #333; }
.pa-root .ticker-search-item:last-child { border-bottom: none; }
.pa-root .ticker-search-item .ts-ticker { font-weight: 500; color: #6b9bd1; min-width: 50px; }
.pa-root .ticker-search-item .ts-name { color: #aaa; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pa-flash-row {
            0% { background: rgba(107,155,209,0.3); }
            100% { background: transparent; }
        }
.pa-root .row-flash td { animation: pa-flash-row 1.5s ease-out; }
.pa-root .spreadsheet-table th.draggable-col { cursor: grab; }
.pa-root .spreadsheet-table th.draggable-col:active { cursor: grabbing; }
.pa-root .spreadsheet-table th.drag-over-col { border-left: 2px solid #6b9bd1 !important; }
.pa-root .spreadsheet-table th.drag-over-col-right { border-right: 2px solid #6b9bd1 !important; }
.pa-root .spreadsheet-table th.dragging-col { opacity: 0.4; }
.pa-root .spreadsheet-table tr.draggable-row td:first-child { cursor: grab; }
.pa-root .spreadsheet-table tr.draggable-row td:first-child:active { cursor: grabbing; }
.pa-root .spreadsheet-table tr.drag-over-row td { border-top: 2px solid #6b9bd1 !important; }
.pa-root .spreadsheet-table tr.drag-over-row-below td { border-bottom: 2px solid #6b9bd1 !important; }
.pa-root .spreadsheet-table tr.dragging-row { opacity: 0.4; }
.pa-root .fa-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 12px; background: #222; border-bottom: 1px solid #333;
            user-select: none; flex-shrink: 0;
        }
.pa-root .fa-title { font-size: 15px; font-weight: 700; color: #fff; }
.pa-root .fa-label { font-size: 14px; font-weight: 600; color: #6b9bd1; margin-left: 8px; }
.pa-root .fa-subtitle { font-size: 11px; color: #888; margin-top: 2px; }
.pa-root .fa-close {
            background: transparent; border: none; color: #888; cursor: pointer;
            font-size: 18px; padding: 0; width: 22px; height: 22px;
            display: flex; align-items: center; justify-content: center;
        }
.pa-root .fa-close:hover { color: #fff; }
.pa-root .fa-body { overflow-y: auto; flex: 1; }
.pa-root .fa-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pa-root .fa-table th {
            padding: 5px 10px; font-size: 11px; font-weight: 700; color: #fff;
            text-transform: uppercase; letter-spacing: 0.3px; text-align: right;
            border-bottom: 2px solid #444; background: #1a1a1a;
            position: sticky; top: 0; z-index: 1;
        }
.pa-root .fa-table th:first-child { text-align: left; }
.pa-root .fa-table td { padding: 4px 10px; border-bottom: 1px solid #2a2a2a; }
.pa-root .fa-table tr:hover td { background: #2a2a2a; }
.pa-root .fa-table .fa-factor { color: #eee; white-space: nowrap; text-align: left; }
.pa-root .fa-table .fa-value { text-align: right; color: #aaa; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 11px; }
.pa-root .fa-table .fa-z { text-align: right; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.pa-root .fa-table .fa-pctl { text-align: right; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.pa-root .fa-table .fa-exp { text-align: right; font-weight: 600; color: #ccc; font-variant-numeric: tabular-nums; }
.pa-root .fa-table .fa-contrib { text-align: right; font-weight: 600; color: #bbb; font-variant-numeric: tabular-nums; }
.pa-root .fa-table .fa-contrib.pos { color: #5fe65f; }
.pa-root .fa-table .fa-contrib.neg { color: #f06060; }
.pa-root .fa-table tr.fa-section td {
            padding: 8px 10px 4px; font-size: 10px; font-weight: 700; color: #c4a94d;
            text-transform: uppercase; letter-spacing: 0.5px; background: #1e1e1e;
            border-bottom: 1px solid #333;
        }
.pa-root .fa-table tr.fa-group td {
            background: #332e1a; border-bottom: 1px solid #4a4020; font-weight: 700;
        }
.pa-root .fa-table tr.fa-group .fa-factor { color: #f0e0a0; font-size: 12px; }
.pa-root .fa-table tr.fa-group .fa-z { font-size: 13px; }
.pa-root .fa-table tr.fa-group .fa-pctl { font-size: 12px; }
.pa-root .fa-table tr.fa-group .fa-contrib { font-weight: 700; }
.pa-root .fa-table tr.fa-total td {
            background: #2a2a2a; border-top: 2px solid #555; font-weight: 700; padding: 7px 10px;
        }
.pa-root .fa-table tr.fa-total .fa-factor { color: #fff; font-size: 13px; }
.pa-root .fa-table tr.fa-total .fa-z { font-size: 14px; }
.pa-root .fa-table tr.fa-total .fa-pctl { font-size: 12px; }
.pa-root .fa-table tr.fa-total .fa-contrib { color: #fff; }
.pa-root .spreadsheet-main { display: flex; flex: 1; overflow: hidden; }
.pa-root .spreadsheet-left { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.pa-root .fa-docked {
            display: none; width: 460px;
            background: #1a1a1a;
            flex-direction: column; overflow: hidden;
            flex-shrink: 0; flex: 1; min-height: 200px;
        }
.pa-root .fa-docked.open { display: flex; }
.pa-root .right-column {
            display: none; width: 40vw; min-width: 480px; max-width: 1100px; flex-shrink: 0;
            flex-direction: column; overflow: hidden;
            border-left: 1px solid #333;
        }
.pa-root .right-column.open { display: flex; }
.pa-root .perf-panel {
            display: none;
            background: #1a1a1a; border-top: 1px solid #333;
            flex-direction: column; overflow: hidden;
            position: relative; flex: 1; min-height: 200px;
        }
.pa-root .perf-panel.open { display: flex; }
.pa-root .perf-spinner {
            width: 28px; height: 28px;
            border: 3px solid #333; border-top-color: #6b9bd1;
            border-radius: 50%;
            animation: pa-perf-spin 0.7s linear infinite;
        }
@keyframes pa-perf-spin { to { transform: rotate(360deg); } }
.pa-root .perf-resize-handle {
            position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
            cursor: col-resize; z-index: 20;
        }
.pa-root .perf-resize-handle:hover, .pa-root .perf-resize-handle.dragging { background: #6b9bd1; }
.pa-root .perf-range-btns { display: flex; gap: 4px; margin-top: 4px; }
.pa-root .perf-range-btn {
            padding: 3px 8px; background: #333; border: 1px solid #444; border-radius: 4px;
            color: #aaa; font-family: 'Manrope', sans-serif; font-size: 10px; font-weight: 500;
            cursor: pointer; transition: all 0.15s;
        }
.pa-root .perf-range-btn:hover { background: #444; border-color: #666; }
.pa-root .perf-range-btn.active { background: #6b9bd1; border-color: #6b9bd1; color: #fff; }
.pa-root .perf-stats {
            display: flex; gap: 16px; padding: 6px 12px; font-size: 11px; border-bottom: 1px solid #333;
        }
.pa-root .perf-stat-label { color: #888; }
.pa-root .perf-stat-value { font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.pa-root .risk-panel {
            display: none;
            background: #1a1a1a; border-top: 1px solid #333;
            flex-direction: column; overflow: hidden;
            position: relative; min-height: 200px;
        }
.pa-root .risk-panel.open { display: flex; flex: 1.2; }
.pa-root .risk-stats {
            display: flex; gap: 16px; padding: 6px 12px; font-size: 11px; border-bottom: 1px solid #333;
            flex-wrap: wrap;
        }
.pa-root .risk-stat { display: flex; align-items: center; }
.pa-root .risk-stat-label { color: #888; }
.pa-root .risk-stat-value { font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.pa-root .risk-table-wrap { flex: 1; overflow-y: auto; overflow-x: auto; max-height: 180px; }
.pa-root .risk-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pa-root .risk-table th {
            position: sticky; top: 0; z-index: 2; background: #222; color: #888; font-weight: 400;
            padding: 5px 8px; text-align: left; border-bottom: 1px solid #333; white-space: nowrap;
            cursor: pointer; user-select: none;
        }
.pa-root .risk-table th:hover { color: #ccc; }
.pa-root .risk-table td { padding: 4px 8px; border-bottom: 1px solid #2a2a2a; color: #ccc; white-space: nowrap; }
.pa-root .risk-table td:first-child { color: #6b9bd1; font-weight: 500; }
.pa-root .risk-table tr:hover td { background: rgba(107,155,209,0.08); }
.pa-root .risk-move-high { color: #ff4444; font-weight: 600; }
.pa-root .risk-move-medium { color: #f0a030; font-weight: 500; }
.pa-root .risk-move-low { color: #888; }
.pa-root .risk-range-btns { display: flex; gap: 4px; margin-top: 4px; }
.pa-root .risk-filters-row { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-bottom: 1px solid #333; flex-wrap: wrap; }
.pa-root .risk-vol-toggles { display: flex; gap: 3px; flex-shrink: 0; }
.pa-root .risk-vol-btn {
            padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
            border: 1px solid var(--vol-color, #888); color: var(--vol-color, #888);
            background: transparent; cursor: pointer; font-family: 'Manrope', sans-serif;
            transition: all 0.15s;
        }
.pa-root .risk-vol-btn.active { background: var(--vol-color, #888); color: #1a1a1a; }
.pa-root .risk-vol-btn:hover { opacity: 0.85; }
.pa-root .risk-vol-divider { width: 1px; height: 18px; background: #444; flex-shrink: 0; }
.pa-root .risk-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.pa-root .risk-filter-pill {
            padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 500;
            border: 1px solid var(--pill-color, #888); color: var(--pill-color, #888);
            background: transparent; cursor: pointer; font-family: 'Manrope', sans-serif;
            transition: all 0.15s; display: flex; align-items: center; gap: 4px;
        }
.pa-root .risk-filter-pill.active { background: var(--pill-color, #888); color: #1a1a1a; font-weight: 600; }
.pa-root .risk-filter-pill:hover { opacity: 0.85; }
.pa-root .risk-filter-count { font-size: 9px; opacity: 0.7; }
.pa-root .panel-drag-handle { cursor: grab; }
.pa-root .panel-drag-handle:active { cursor: grabbing; }
.pa-root .panel-drag-ghost {
            position: fixed; pointer-events: none; z-index: 10000;
            opacity: 0.7; border: 1px solid #6b9bd1; border-radius: 4px;
            background: #1a1a1a; box-shadow: 0 4px 16px rgba(0,0,0,0.5);
        }
.pa-root .panel-drop-indicator {
            height: 3px; background: #6b9bd1; border-radius: 2px;
            margin: -2px 0; transition: opacity 0.1s; z-index: 5;
        }
.pa-root .fa-tabs {
            display: flex; border-bottom: 1px solid #333; flex-shrink: 0; background: #1e1e1e;
        }
.pa-root .fa-tab {
            flex: 1; padding: 7px 12px; background: transparent; border: none; border-bottom: 2px solid transparent;
            color: #888; font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600;
            cursor: pointer; transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.3px;
        }
.pa-root .fa-tab:hover { color: #ccc; background: #252525; }
.pa-root .fa-tab.active { color: #6b9bd1; border-bottom-color: #6b9bd1; }
.pa-root .fa-tab-content { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.pa-root .fa-tab-content.active { display: flex; }
.pa-root .fa-docked.expanded { flex: 1 1 100% !important; }
.pa-root .fa-docked.expanded ~ .perf-panel { display: none !important; }
.pa-root .fa-popup {
            display: none; position: fixed; z-index: 500;
            width: 540px; max-height: 80vh;
            background: #1a1a1a; border: 1px solid #444; border-radius: 6px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.7);
            font-family: 'Manrope', sans-serif; overflow: hidden;
            flex-direction: column;
        }
.pa-root .fa-popup.open { display: flex; }
.pa-root .fa-popup .fa-header { cursor: grab; }
.pa-root .fa-popup .fa-header:active { cursor: grabbing; }
.pa-root .cell-ticker { font-weight: 500; color: #6b9bd1; }
.pa-root .cell-ticker a { color: #6b9bd1; text-decoration: none; }
.pa-root .cell-ticker a:hover { text-decoration: underline; }
.pa-root .btn-drilldown {
            background: transparent; border: 1px solid #444; color: #888; cursor: pointer;
            font-size: 9px; padding: 1px 4px; border-radius: 3px; margin-left: 6px;
            font-family: 'Manrope', sans-serif; font-weight: 600; vertical-align: middle;
        }
.pa-root .btn-drilldown:hover { border-color: #6b9bd1; color: #6b9bd1; background: rgba(107,155,209,0.1); }
.pa-root .cell-name { color: #ccc; }
.pa-root .cell-weight { text-align: left; }
.pa-root .cell-number { text-align: left; color: #e0e0e0; }
.pa-root .cell-percent { text-align: left; }
.pa-root .cell-boolean { text-align: center; }
.pa-root .cell-return { font-variant-numeric: tabular-nums; }
.pa-root .cell-return.cell-pos { color: #5cc47c; }
.pa-root .cell-return.cell-neg { color: #d97a7a; }
.pa-root .cell-editable {
            cursor: text; padding: 4px 8px;
        }
.pa-root .cell-editable:hover { background: #333 !important; }
.pa-root .cell-input {
            width: 100%; background: transparent; border: 1px solid #6b9bd1;
            color: #fff; font-family: 'Manrope', sans-serif; font-size: 12px;
            padding: 2px 4px; outline: none; border-radius: 2px;
        }
.pa-root .cell-action {
            text-align: center; width: 30px; padding: 4px;
        }
.pa-root .btn-remove-row {
            background: transparent; border: none; color: #f87171; cursor: pointer;
            font-size: 16px; padding: 0; width: 20px; height: 20px;
            display: inline-flex; align-items: center; justify-content: center;
            border-radius: 2px;
        }
.pa-root .btn-remove-row:hover { background: rgba(248,113,113,0.2); }
.pa-root .row-add {
            background: #2a2a2a; border-top: 1px solid #333;
            flex-shrink: 0;
        }
.pa-root .row-add-input {
            padding: 8px 12px; display: flex; gap: 8px; align-items: center;
        }
.pa-root .row-add-input input {
            flex: 1; padding: 6px 10px; background: #1e1e1e; border: 1px solid #444;
            border-radius: 4px; color: #e0e0e0; font-family: 'Manrope', sans-serif; font-size: 12px;
            outline: none;
        }
.pa-root .row-add-input input:focus { border-color: #6b9bd1; }
.pa-root .modal-overlay {
            display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center;
        }
.pa-root .modal-overlay.open { display: flex; }
.pa-root .modal {
            background: #252525; border-radius: 8px; border: 1px solid #444;
            padding: 20px; max-width: 720px; width: 90%; max-height: 80vh; overflow-y: auto;
        }
.pa-root .modal-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #333;
        }
.pa-root .modal-title { font-size: 16px; font-weight: 600; color: #fff; }
.pa-root .modal-close {
            background: transparent; border: none; color: #999; cursor: pointer;
            font-size: 20px; padding: 0; width: 24px; height: 24px;
        }
.pa-root .modal-close:hover { color: #fff; }
.pa-root .column-list {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
        }
.pa-root .column-section-divider {
            grid-column: 1 / -1; font-size: 10px; font-weight: 600; color: #999;
            text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 0 2px;
            border-bottom: 1px solid #333; margin-bottom: 0;
        }
.pa-root .column-section-divider:first-child { padding-top: 0; }
.pa-root .column-item {
            padding: 6px 10px; background: #1e1e1e; border: 1px solid #333;
            border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px;
            transition: all 0.2s;
        }
.pa-root .column-item:hover { border-color: #6b9bd1; background: #2a2a2a; }
.pa-root .column-item.active { border-color: #6b9bd1; background: rgba(107,155,209,0.1); }
.pa-root .column-checkbox {
            width: 16px; height: 16px; cursor: pointer;
        }
.pa-root .column-label { flex: 1; font-size: 12px; color: #e0e0e0; }
.pa-root .column-type { font-size: 10px; color: #666; }
.pa-root .toast {
            position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
            background: #252525; border: 1px solid #444; border-radius: 8px;
            padding: 12px 20px; color: #e0e0e0; font-size: 13px; font-family: 'Manrope', sans-serif;
            box-shadow: 0 4px 16px rgba(0,0,0,0.5); z-index: 2000;
            display: flex; align-items: center; gap: 10px;
            opacity: 0; transition: opacity 0.25s, transform 0.25s;
            pointer-events: none;
        }
.pa-root .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.pa-root .toast-icon { font-size: 16px; flex-shrink: 0; }
.pa-root .toast-msg { flex: 1; }
.pa-root .loading { display: flex; align-items: center; justify-content: center; padding: 80px; color: #555; font-size: 13px; gap: 10px; }
.pa-root .spinner { width: 18px; height: 18px; border: 2px solid #444; border-top-color: #999; border-radius: 50%; animation: pa-spin 0.7s linear infinite; }
@keyframes pa-spin { to { transform: rotate(360deg); } }
.pa-root .hidden { display: none; }

/* theme.js turns the page light with a rule on body, which the host's own background would
   otherwise outrank. */
body.light-mode .pa-root { background: #f5f5f5; color: #222; }
