:root{
  --bg:#071016;--bg2:#0b161f;--panel:#0e1c26;--panel2:#12232f;--border:#1e3442;
  --text:#e8f0f4;--muted:#8fa5b3;--soft:#b9c9d2;--accent:#52d3a7;--accent2:#68a8ff;
  --warn:#ffcf70;--bad:#ff8d8d;--good:#65ddb1;--grid:#17303d;--shadow:0 18px 48px rgba(0,0,0,.28);
}
*{box-sizing:border-box} body{margin:0;background:linear-gradient(180deg,#061017 0,#08131b 45%,#071017 100%);
color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}
button,input,select{font:inherit} .app{display:grid;grid-template-columns:248px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:#08131a;border-right:1px solid var(--border);padding:22px 14px;display:flex;flex-direction:column;gap:18px}
.brand{padding:5px 10px 15px}.brand .name{font-weight:750;letter-spacing:.02em;font-size:18px}.brand .sub{color:var(--muted);font-size:12px;margin-top:3px}
.nav-title{padding:0 10px;color:#607987;text-transform:uppercase;letter-spacing:.14em;font-size:10px;font-weight:750}
.nav button{width:100%;text-align:left;background:transparent;color:var(--soft);border:0;border-radius:9px;padding:10px 11px;margin:2px 0;cursor:pointer}
.nav button:hover{background:#0f202b;color:#fff}.nav button.active{background:#132833;color:#fff;box-shadow:inset 2px 0 var(--accent)}
.side-bottom{margin-top:auto;color:#738c99;font-size:11px;line-height:1.55;padding:12px 10px;border-top:1px solid var(--border)}
.main{min-width:0}.topbar{position:sticky;top:0;z-index:10;background:rgba(7,16,22,.9);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);
display:flex;align-items:center;justify-content:space-between;padding:15px 24px}.title h1{font-size:18px;margin:0;letter-spacing:-.01em}.title p{margin:3px 0 0;color:var(--muted);font-size:11px}
.badges{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.badge{padding:5px 8px;border-radius:999px;border:1px solid var(--border);font-size:10px;font-weight:750;letter-spacing:.04em}
.badge.good{background:rgba(82,211,167,.09);color:var(--good);border-color:rgba(82,211,167,.3)}.badge.warn{background:rgba(255,207,112,.08);color:var(--warn);border-color:rgba(255,207,112,.3)}
.badge.dark{color:#bcd0da}.wrap{padding:22px 24px;max-width:1540px;margin:0 auto}.notice{border:1px solid var(--border);border-radius:12px;padding:11px 14px;background:#0b1922;color:#a9bdc8;margin-bottom:16px;line-height:1.5;font-size:12.5px}
.notice.warn{border-color:rgba(255,207,112,.28);background:rgba(255,207,112,.055)}.notice strong{color:#fff}
.grid{display:grid;gap:14px}.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}
.panel,.chart{background:linear-gradient(180deg,var(--panel) 0,var(--bg2) 100%);border:1px solid var(--border);border-radius:13px;box-shadow:var(--shadow)}
.panel{padding:16px}.chart{padding:14px 14px 10px;min-height:330px}.section{margin-top:15px}
.panel-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.panel-title h3{margin:0;font-size:14px}.panel-title p{margin:4px 0 0;color:var(--muted);font-size:11px}
.kpi{padding:12px 14px;background:linear-gradient(180deg,#10212c,#0c1821);border:1px solid var(--border);border-radius:12px}.kpi .k{color:var(--muted);font-size:10px}.kpi .v{font-size:22px;font-weight:750;margin-top:4px;letter-spacing:-.02em}.kpi .note{color:#6f8997;font-size:9.5px;margin-top:3px}
.kpi.accent{box-shadow:inset 0 2px var(--accent)}.profile-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:8px 0 16px}.profile-tabs button{border:1px solid var(--border);border-radius:8px;background:#0d1b24;color:#9eb4c0;padding:7px 10px;cursor:pointer}
.profile-tabs button.active{background:#153128;color:#eafff8;border-color:#2a755d}.metric-strip{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.mini{background:#0a1820;border:1px solid var(--border);border-radius:9px;padding:10px}.mini span{display:block;color:var(--muted);font-size:10px}.mini b{font-size:15px;display:block;margin-top:3px}
.tablewrap{overflow:auto;border:1px solid var(--border);border-radius:10px}.tbl{width:100%;border-collapse:collapse;min-width:680px}.tbl th,.tbl td{padding:9px 10px;border-bottom:1px solid #17303b;text-align:left;white-space:nowrap}
.tbl th{position:sticky;top:0;background:#0f2029;color:#7892a0;font-size:10px;text-transform:uppercase;letter-spacing:.05em}.tbl td{font-size:12px}.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.goodtext{color:var(--good)}.warntext{color:var(--warn)}.badtext{color:var(--bad)}.muted{color:var(--muted)}
.svgchart{width:100%;height:270px;display:block}.chart-tooltip{position:fixed;pointer-events:none;background:#071017;border:1px solid #2b4554;border-radius:8px;padding:8px 10px;font-size:11px;color:#dce9ee;box-shadow:0 8px 30px rgba(0,0,0,.35);display:none;z-index:99}
.legend{display:flex;gap:14px;flex-wrap:wrap;color:var(--muted);font-size:10px;margin-bottom:5px}.legend span i{display:inline-block;width:9px;height:2px;margin-right:5px;vertical-align:middle}.legend .a i{background:var(--accent)}.legend .b i{background:var(--accent2)}.legend .c i{background:var(--warn)}
.heatmap{overflow:auto;border:1px solid var(--border);border-radius:10px}.heatgrid{border-collapse:separate;border-spacing:1px;background:#0a151c}.heatgrid th{font-size:9px;color:#77909d;padding:5px;background:#0d1b23;position:sticky;top:0}.heatgrid th:first-child{left:0;z-index:3}.heatgrid td:first-child{position:sticky;left:0;background:#0d1b23;color:#9bb0bc;font-weight:650;font-size:10px;padding:5px 8px;z-index:2}.heatgrid td.cell{width:21px;height:21px;background:#0b1921}.heatgrid td.cell.on{background:#256b55}.heatgrid td.cell.new{background:#4a84a9}
.flow{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;align-items:stretch}.flow .step{padding:13px;border:1px solid var(--border);border-radius:10px;background:#0c1a23}.flow .n{font-size:10px;color:var(--accent)}.flow b{font-size:12px;display:block;margin-top:4px}.flow p{font-size:10px;color:var(--muted);line-height:1.45;margin:6px 0 0}
.status-list{display:grid;gap:8px}.status-row{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid #17303b;padding:8px 0}.status-row span{color:var(--muted)}
.page{display:none}.page.active{display:block}.footer{display:flex;justify-content:space-between;gap:20px;color:#637d89;font-size:10px;border-top:1px solid var(--border);margin-top:24px;padding-top:14px}
@media(max-width:1100px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto;border-right:0;border-bottom:1px solid var(--border)}.nav{display:flex;flex-wrap:wrap}.nav button{width:auto}.side-bottom{display:none}.cols4,.cols3{grid-template-columns:repeat(2,1fr)}.flow{grid-template-columns:repeat(2,1fr)}.metric-strip{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.topbar{align-items:flex-start;gap:10px;flex-direction:column}.wrap{padding:14px}.cols4,.cols3,.cols2{grid-template-columns:1fr}.metric-strip{grid-template-columns:repeat(2,1fr)}.kpi .v{font-size:22px}.footer{flex-direction:column}.chart{min-height:310px}}

.top-actions{display:flex;align-items:center;gap:14px;justify-content:flex-end;flex-wrap:wrap}
.profile-global{display:grid;grid-template-columns:auto minmax(150px,auto);align-items:center;gap:4px 8px;padding:7px 10px;border:1px solid var(--border);border-radius:10px;background:#0b1922}
.profile-global>span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;font-weight:700}
.profile-global select{background:#10232d;color:var(--text);border:1px solid #294250;border-radius:7px;padding:6px 8px;outline:none;cursor:pointer}
.profile-global small{grid-column:1/-1;color:#6f8997;font-size:9px;white-space:nowrap}
@media(max-width:700px){.top-actions{width:100%;justify-content:flex-start}.profile-global{width:100%;grid-template-columns:auto 1fr}.profile-global small{white-space:normal}}

.universe-search input{background:#0e2029;color:var(--text);border:1px solid #294250;border-radius:8px;padding:7px 10px;min-width:230px;outline:none}
.universe-search input:focus{border-color:#4b7f92}


.risk-slider-row{
  display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,2fr) minmax(150px,.7fr);
  gap:18px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:11px;background:#0a1820
}
.risk-slider-row label{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:700}
.slider-value{display:flex;gap:10px;align-items:baseline;margin-top:5px}.slider-value b{font-size:23px}.slider-value span{color:var(--muted);font-size:11px}
.risk-slider-row input[type=range]{width:100%;accent-color:var(--accent)}
.te-readout{text-align:right}.te-readout span{display:block;color:var(--muted);font-size:10px}.te-readout b{font-size:20px}
.allocation-layout{display:grid;grid-template-columns:190px 1fr;gap:20px;align-items:center}
.donut{width:170px;height:170px;border-radius:50%;position:relative;margin:auto;background:conic-gradient(var(--accent2) 0 0%,var(--accent) 0% 100%)}
.donut:after{content:"";position:absolute;inset:28px;border-radius:50%;background:#0d1b24;border:1px solid var(--border)}
.donut-center{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.donut-center b{font-size:23px}.donut-center span{color:var(--muted);font-size:10px;margin-top:3px}
.bar-row{display:grid;grid-template-columns:125px 1fr 70px;gap:9px;align-items:center;margin:10px 0}
.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--soft);font-size:11px}
.bar-track{height:10px;border-radius:99px;background:#102530;overflow:hidden}.bar-fill{height:100%;border-radius:99px;background:var(--accent)}
.bar-fill.core{background:var(--accent2)}.bar-value{text-align:right;font-variant-numeric:tabular-nums;font-size:11px}
.universe-controls{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}.profile-tabs.compact{margin:0}
.universe-controls select,.universe-controls input{background:#0e2029;color:var(--text);border:1px solid #294250;border-radius:8px;padding:7px 10px;outline:none}
.universe-controls input{min-width:230px}.universe-table{max-height:590px}
.selected-row td{background:rgba(82,211,167,.06)}.pill{display:inline-block;border:1px solid var(--border);border-radius:999px;padding:3px 7px;font-size:9px}
.pill.good{color:var(--good);border-color:rgba(82,211,167,.3);background:rgba(82,211,167,.08)}
.pill.muted{color:var(--muted)}
@media(max-width:900px){.risk-slider-row{grid-template-columns:1fr}.te-readout{text-align:left}.allocation-layout{grid-template-columns:1fr}.universe-controls{justify-content:flex-start}}

.live-strip{margin-bottom:12px}.live-strip .kpi{padding:11px 13px}.live-strip .kpi .v{font-size:18px}.cols6{grid-template-columns:repeat(6,minmax(0,1fr))}@media(max-width:1200px){.cols6{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){.cols6{grid-template-columns:1fr 1fr}}

.rank-rule-note{
 display:flex;flex-wrap:wrap;gap:8px 18px;
 margin-top:10px;padding:9px 11px;
 border:1px solid var(--line);border-radius:9px;
 color:var(--muted);font-size:12px;line-height:1.45;
 background:rgba(255,255,255,.018)
}
.rank-rule-note b{color:var(--text)}


/* v1.5.0.11 — Rank/source clarity and compact Official portfolio */
.portfolio-legend{
 display:flex;flex-wrap:wrap;gap:7px 15px;margin:-2px 0 10px;
 padding:8px 10px;border:1px solid var(--border);border-radius:9px;
 background:#0a1820;color:var(--muted);font-size:10px;line-height:1.4
}
.portfolio-legend b{color:var(--text)}
.holding-card-grid{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px
}
.holding-card{
 min-width:0;border:1px solid var(--border);border-radius:9px;
 background:#0a1820;padding:9px 10px
}
.holding-card-top,.holding-card-bottom{
 display:flex;align-items:center;justify-content:space-between;gap:10px
}
.holding-ticker{display:flex;align-items:baseline;gap:8px;min-width:0}
.holding-ticker b{font-size:12px;min-width:39px}
.holding-ticker span{
 color:var(--soft);font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.holding-weight{font-weight:750;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.holding-card-bottom{margin-top:6px}
.holding-badges{display:flex;gap:4px;flex-wrap:wrap}
.holding-reason{
 color:var(--muted);font-size:9px;text-align:right;white-space:nowrap;
 overflow:hidden;text-overflow:ellipsis;min-width:0
}
.rank-explainer{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:10px
}
.rank-explainer>div{
 border:1px solid var(--border);border-radius:9px;background:#0a1820;padding:9px 10px
}
.rank-explainer b{display:block;color:var(--text);font-size:10px;margin-bottom:3px}
.rank-explainer span{display:block;color:var(--muted);font-size:9px;line-height:1.4}
.rank-watch-table{min-width:610px}
@media(max-width:900px){
 .holding-card-grid{grid-template-columns:1fr}
 .rank-explainer{grid-template-columns:1fr}
}


/* v1.5.0.14 — Preview / Broad-rank interpretation UX */
.preview-legend{margin-top:0}
.preview-card.new{border-color:rgba(82,211,167,.36);background:rgba(82,211,167,.035)}
.preview-card.weight_change{border-color:rgba(245,190,74,.34)}
.pill.warn{color:#f5c85b;border-color:rgba(245,200,91,.34);background:rgba(245,200,91,.07)}
.preview-unavailable{
 padding:14px;border:1px dashed var(--border);border-radius:9px;
 color:var(--muted);font-size:11px;background:#0a1820
}
.rank-weight-note{
 margin:-1px 0 10px;padding:8px 10px;border:1px solid rgba(245,200,91,.2);
 border-radius:8px;background:rgba(245,200,91,.035);
 color:var(--muted);font-size:10px;line-height:1.45
}
.rank-weight-note b{color:var(--text)}


/* v1.5.0.16 — history / robustness / architecture closeout */
.history-clock-note{
 margin:0 0 10px;padding:9px 11px;border:1px solid var(--border);border-radius:9px;
 background:#0a1820;color:var(--muted);font-size:10px;line-height:1.45
}
.history-clock-note b{color:var(--text)}
.history-open-row td{background:rgba(245,200,91,.035)}
.history-open-row small{color:#f5c85b;font-size:8px;margin-left:3px}
.heatgrid td.open-decision{box-shadow:inset 0 0 0 1px rgba(245,200,91,.5)}
.architecture-flow{grid-template-columns:repeat(3,minmax(0,1fr))}
.architecture-flow .static-step{border-color:rgba(245,200,91,.28);background:rgba(245,200,91,.025)}
@media(max-width:1100px){.architecture-flow{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.architecture-flow{grid-template-columns:1fr}}


/* v1.5.0.21 — compact upper information hierarchy */
.topbar{padding-top:13px;padding-bottom:13px}
.profile-global{padding:6px 9px}
.profile-global select{padding:5px 7px;font-size:12px}
#page-cockpit>.grid:first-child{gap:10px}
@media(max-width:700px){.notice{font-size:12px}.title h1{font-size:17px}.kpi .v{font-size:20px}}

/* v1.5.0.22 — mobile containment / responsive dashboard closeout */
.grid>*{min-width:0;max-width:100%}
.panel,.chart{min-width:0;max-width:100%}
.tablewrap,.heatmap{min-width:0;max-width:100%}
.panel-title>div{min-width:0}
.status-row>*{min-width:0}
.profile-global select{min-width:0;max-width:100%}
@media(max-width:700px){
 .panel-title{flex-wrap:wrap}
 .panel-title .badge{max-width:100%;white-space:normal}
 .status-row{gap:10px;align-items:flex-start}
 .status-row span{overflow-wrap:anywhere}
 .status-row b{max-width:58%;text-align:right;overflow-wrap:anywhere;word-break:break-word}
 .universe-controls{width:100%;min-width:0}
 .universe-controls input,.universe-controls select{min-width:0;max-width:100%}
 .universe-controls input{width:100%}
 .profile-global{min-width:0}
 .profile-global select{width:100%}
 .flow{grid-template-columns:1fr}
 .rank-explainer>div{min-width:0}
 .rank-rule-note,.rank-weight-note,.portfolio-legend{max-width:100%;overflow-wrap:anywhere}
 .holding-card-top,.holding-card-bottom{min-width:0}
}

.support-strip{margin-top:10px;padding:8px 11px;border:1px solid rgba(139,172,190,.22);border-radius:9px;background:rgba(9,25,34,.65);color:#8fb0c1;font-size:11px;line-height:1.45}.support-strip strong{color:#dceaf0}.support-strip.section{margin-top:15px}

.monthly-history-table{max-height:590px}


/* v1.5.0.89 — preview readability / rank-table containment */
.preview-card .holding-reason,.holding-card .holding-reason{overflow:visible;text-overflow:clip;flex:0 0 auto}
.rank-watch-table{min-width:0!important;width:100%;table-layout:fixed}
.rank-watch-table th:nth-child(1),.rank-watch-table td:nth-child(1){width:13%}
.rank-watch-table th:nth-child(2),.rank-watch-table td:nth-child(2){width:13%}
.rank-watch-table th:nth-child(3),.rank-watch-table td:nth-child(3){width:18%}
.rank-watch-table th:nth-child(4),.rank-watch-table td:nth-child(4){width:22%}
.rank-watch-table th:nth-child(5),.rank-watch-table td:nth-child(5){width:34%;white-space:normal}
#previewSummary .status-row b{max-width:64%;text-align:right;line-height:1.35}


/* v1.5.0.90 — Cockpit / Performance reader closeout */
.returns-table-wrap{overflow-x:hidden}
.returns-table{min-width:0!important;width:100%;table-layout:fixed}
.returns-table th:first-child,.returns-table td:first-child{width:22%;padding-left:10px;padding-right:6px}
.returns-table th:not(:first-child),.returns-table td:not(:first-child){width:26%;padding-left:6px;padding-right:8px}
@media(max-width:700px){.returns-table th,.returns-table td{font-size:11px;padding-left:5px!important;padding-right:5px!important}.returns-table th:first-child,.returns-table td:first-child{width:25%}.returns-table th:not(:first-child),.returns-table td:not(:first-child){width:25%}}

.panel-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.export-btn{display:inline-flex;align-items:center;border:1px solid #2a755d;border-radius:8px;background:#123027;color:#dffbf0;text-decoration:none;padding:7px 10px;font-size:11px;font-weight:700;white-space:nowrap}
.export-btn:hover{background:#173b30;border-color:#3b9a79}

/* v1.5.0.92 — final Active Risk / Robustness reader QA */
.compact-tablewrap{overflow-x:hidden}
.risk-profile-table,.robustness-cost-table,.robustness-blend-table{min-width:0!important;width:100%;table-layout:fixed}
.risk-profile-table th:first-child,.risk-profile-table td:first-child{width:31%;white-space:normal}
.risk-profile-table th:not(:first-child),.risk-profile-table td:not(:first-child){width:11.5%;padding-left:6px;padding-right:6px}
.robustness-cost-table th,.robustness-cost-table td{width:16.666%;padding-left:6px;padding-right:6px}
.robustness-blend-table th:first-child,.robustness-blend-table td:first-child{width:34%;white-space:normal}
.robustness-blend-table th:not(:first-child),.robustness-blend-table td:not(:first-child){width:16.5%;padding-left:6px;padding-right:6px}
.selected-spec-row{background:rgba(75,210,165,.07)}
.selected-spec-row td:first-child{font-weight:700}
@media(max-width:900px){.compact-tablewrap{overflow-x:auto}.risk-profile-table,.robustness-cost-table,.robustness-blend-table{min-width:660px!important}}
