/* Allocation cards: a full-width name, then three clearly labelled fields. */
@media(min-width:1201px){
 html.customer-experience .layout-stage .portfolio{display:flex;flex-direction:column;overflow-y:auto}
 html.customer-experience .portfolio>.panel-title,html.customer-experience .portfolio>.constraints,html.customer-experience .portfolio>.portfolio-actions,html.customer-experience .portfolio>.workflow,html.customer-experience .portfolio>#permission-note{flex-shrink:0}
 html.customer-experience .portfolio>.table-wrap{flex:1 0 260px;display:flex;min-height:260px}
 html.customer-experience .portfolio>.table-wrap>table{display:flex;flex-direction:column;flex:1;width:100%}
 html.customer-experience .portfolio thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 html.customer-experience .portfolio #allocations{display:flex;flex-direction:column;flex:1;min-width:0}
 html.customer-experience .portfolio #allocations>tr{display:grid;grid-template-columns:minmax(130px,1.2fr) minmax(0,1fr) minmax(0,1fr);gap:14px 16px;flex:1;align-content:center;padding:18px 16px;border-bottom:1px solid #294050}
 html.customer-experience .portfolio #allocations>tr>td{display:block;min-width:0;width:auto;padding:0;border:0;font-size:14px;text-align:left;overflow-wrap:anywhere}
 html.customer-experience .portfolio #allocations>tr>td:first-child{grid-column:1/-1}
 html.customer-experience .portfolio #allocations>tr>td:first-child b{display:block;max-width:100%;white-space:normal;overflow-wrap:anywhere;font-size:17px;line-height:1.5}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(n+2)::before{display:block;margin-bottom:7px;color:#8ba4b8;font-size:11px;line-height:1.5;font-weight:400}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)::before{content:'预算仓位'}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(3)::before{content:'配置金额'}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(4)::before{content:'历史表现'}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)>strong{font-size:16px}
 html.customer-experience .portfolio #allocations small{line-height:1.6}
 html.customer-experience .portfolio .draft-weight-control{width:100%;max-width:190px;gap:6px;margin:7px 0}
 html.customer-experience .portfolio .draft-weight-control input{width:0;min-width:22px;flex:1}
 html.customer-experience .portfolio .draft-weight-step{flex:0 0 28px;width:28px;height:30px;font-size:18px}
 html.customer-experience .portfolio .portfolio-actions{margin:12px 14px 8px}
 html.customer-experience .portfolio .portfolio-actions button{min-height:44px;font-size:15px}
 html.customer-experience .portfolio #memberMetrics{margin:10px 14px 14px}
}
@media(max-width:1200px){
 html.customer-experience .portfolio #allocations>tr{padding-top:20px;padding-bottom:20px}
 html.customer-experience .portfolio #allocations>tr>td:first-child b{white-space:normal;overflow-wrap:anywhere}
 html.customer-experience .portfolio .portfolio-actions button{min-height:44px}
}
@media(min-width:1201px){
 html.customer-experience .portfolio #allocations>tr{padding:12px 16px;gap:10px 16px;min-height:145px}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2){display:grid;grid-template-columns:34px minmax(0,1fr);gap:3px 6px;align-content:start;align-items:center}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)::before,html.customer-experience .portfolio #allocations>tr>td:nth-child(2)>small{grid-column:1/-1}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)>.draft-weight-label{grid-column:1;font-size:15px}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)>.draft-weight-control{grid-column:2;min-width:0;margin:0}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(n+2)::before{margin-bottom:3px}
 html.customer-experience .portfolio #allocations>tr>td:nth-child(2)>small{font-size:10px}
 html.customer-experience .portfolio #allocations{min-height:0}
 html.customer-experience .portfolio>.table-wrap{min-height:300px;flex:1 0 auto}
 html.customer-experience .portfolio>.table-wrap>table{height:auto;min-height:300px}
}
/* Let 1–3 members fill the card naturally; extra content grows the page, not an inner scroller. */
html.customer-experience .portfolio #rationale:empty{display:none}
@media(min-width:1201px){
 html.customer-experience .layout-stage .portfolio{height:auto;min-height:537px;overflow:visible}
 html.customer-experience .layout-stage .engine{height:auto;min-height:537px}
 html.customer-experience .portfolio #allocations:has(>tr:nth-child(3))>tr{padding:10px 16px;gap:7px 16px;min-height:112px}
 html.customer-experience .portfolio #allocations:has(>tr:nth-child(3))>tr>td:first-child b{font-size:15px;line-height:1.4}
 html.customer-experience .portfolio #allocations:has(>tr:nth-child(3))>tr>td:nth-child(n+2)::before{display:none}
 html.customer-experience .portfolio #allocations:has(>tr:nth-child(3))>tr>td{font-size:13px}
}

.saved-curve{margin:20px 0;padding:18px 16px;border:1px solid #294050;border-radius:12px;min-width:0;background:#0b1924}.saved-curve h4{margin:0 0 8px}.saved-curve-asof,.saved-curve-basis{display:block;color:#8ba4b8;line-height:1.6}.saved-curve .saved-metrics{margin:14px 0}.saved-curve-graph{width:100%;min-width:0}.saved-curve-graph svg{display:block;width:100%;height:auto;max-height:280px}.saved-curve-graph .curve-label,.saved-curve-graph .curve-axis-title{fill:#8ba4b8}.saved-curve-retry{margin-top:8px}@media(max-width:600px){.saved-curve{padding:14px 8px}.saved-curve-graph svg{min-height:190px}.saved-curve .saved-metrics{gap:8px}.saved-curve .saved-metrics strong{font-size:17px}}

#export{display:none!important}.saved-list-controls{display:flex;align-items:end;flex-wrap:wrap;gap:14px;margin:18px 0}.saved-search-label{display:grid;gap:6px;flex:1;min-width:180px;color:#91adbf;font-size:13px}.saved-search{width:100%;box-sizing:border-box;border:1px solid #294050;background:#10232f;color:#c9dbe5;padding:10px 12px;border-radius:8px;min-height:42px}.saved-list-count{color:#91adbf;font-size:13px}.saved-pagination{display:flex;align-items:center;gap:12px}.saved-pagination button{min-height:40px}.saved-pagination button:disabled{opacity:.4}.saved-compact-members{margin:10px 0;color:#afc7d8;font-size:14px;overflow-wrap:anywhere}.saved-expanded{border-top:1px solid #294050;padding-top:10px}.saved-expanded>summary{cursor:pointer;color:#7ce8b5;padding:8px 0;list-style:none}.saved-expanded>summary::before{content:'＋';margin-right:8px}.saved-expanded[open]>summary::before{content:'−'}.saved-card{margin-bottom:14px}.saved-heading{gap:12px}.saved-heading .saved-description{min-width:0;overflow-wrap:anywhere}@media(max-width:600px){.saved-list-controls{align-items:stretch}.saved-pagination{width:100%;justify-content:space-between}.saved-heading .saved-description{font-size:16px}}

.saved-search{font-family:inherit;font-size:14px}.saved-search::placeholder{font-family:inherit;color:#91adbf}#saved-plan{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}#saved-plan>.saved-list-controls,#saved-plan>.detail-note{grid-column:1/-1}#saved-plan>.saved-card{min-width:0;margin:0}#saved-plan>.saved-card:has(.saved-expanded[open]){grid-column:1/-1}@media(max-width:900px){#saved-plan{grid-template-columns:minmax(0,1fr)}}

#mine>button{margin-top:16px}#saved-plan>.saved-list-controls{margin:8px 0 2px}

/* Use the same caption and primary-value tracks across allocation fields. */
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(3){line-height:44px;font-size:15px}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(3)::before{content:'配置金额';display:block;min-height:36px;margin:0;color:#8ba4b8;font-size:11px;line-height:18px;font-weight:400}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4){display:flex;flex-direction:column;align-items:stretch}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)::before{display:none}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>small:first-child{display:block;min-height:36px;margin:0;color:#8ba4b8;font-size:11px;line-height:18px;font-weight:400}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>span{display:block;min-height:44px;line-height:44px;font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap}
html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>small:not(:first-child){margin-top:6px;line-height:1.6}
@media(min-width:1201px){
 html.customer-experience #build .portfolio .table-wrap #allocations>tr{align-items:start}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2){grid-template-columns:34px minmax(0,1fr);row-gap:0}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)::before{content:'预算仓位';display:block;min-height:36px;margin:0;font-size:11px;line-height:18px}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>.draft-weight-label{min-height:44px;line-height:44px;font-size:15px;font-variant-numeric:tabular-nums}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>.draft-weight-control{height:44px;margin:0;align-items:center}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>small{margin-top:6px;line-height:1.6}
}
@media(max-width:1200px){
 html.customer-experience .portfolio .table-wrap{overflow:visible;padding:0 12px}
 html.customer-experience .portfolio .table-wrap table,html.customer-experience .portfolio .table-wrap tbody{display:block;width:100%;min-width:0}
 html.customer-experience .portfolio .table-wrap thead{display:none}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;padding:16px 0}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td{display:block;width:auto;min-width:0;padding:0;border:0;overflow-wrap:anywhere}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4){display:flex}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(-n+2){grid-column:1/-1}
}

/* Keep cards sized by their content, with a bounded drawing surface. */
@media(min-width:1201px){
 html.customer-experience .layout-stage .engine,
 html.customer-experience .layout-stage .portfolio{min-height:420px}
 html.customer-experience .layout-stage .engine .brain-wrap{position:relative;min-height:280px}
 html.customer-experience .layout-stage .engine #brain{position:absolute;inset:0;width:100%;height:100%}
 html.customer-experience .portfolio>.table-wrap{min-height:0;flex:1 0 auto}
 html.customer-experience .portfolio>.table-wrap>table{min-height:0}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr{min-height:0;padding:12px 16px;gap:6px 14px;align-content:start}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)::before,
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(3)::before,
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>small:first-child{min-height:22px;line-height:18px}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>.draft-weight-label,
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(3),
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>span{min-height:34px;line-height:34px}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>.draft-weight-control{height:34px}
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(2)>small,
 html.customer-experience #build .portfolio .table-wrap #allocations>tr>td:nth-child(4)>small:not(:first-child){margin-top:4px;line-height:1.5}
 html.customer-experience .portfolio #allocations:has(>tr:only-child)>tr{align-content:center}
}
