/* Portfolio pages share a layout with the dashboard's dark surfaces. */
.portfolio-page, main > #profits, main > #reports { --portfolio-surface:#151d2b; --portfolio-edge:#2b394e; --portfolio-muted:#a9b7cb; padding:clamp(12px,2vw,28px); }
.portfolio-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; }
.portfolio-page .portfolio-heading { position:static; padding:0; background:transparent; border:0; height:auto; }
.portfolio-heading h1 { font:800 clamp(24px,3vw,34px)/1.2 system-ui,sans-serif; margin:0 0 6px; }
.portfolio-page h2 { font:750 19px/1.3 system-ui,sans-serif; margin:0; }
.portfolio-page p, .portfolio-page small, .portfolio-card > span { color:var(--portfolio-muted); }
.portfolio-heading p,.portfolio-card p { margin:6px 0; }
.portfolio-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:12px; margin-bottom:12px; }
.portfolio-card { min-width:0; background:var(--portfolio-surface); border:1px solid var(--portfolio-edge); border-radius:12px; padding:clamp(13px,2vw,20px); }
.portfolio-page > .portfolio-card { margin-bottom:12px; }
.portfolio-metrics strong { display:block; margin:10px 0 5px; font-size:clamp(20px,2.5vw,32px); overflow-wrap:anywhere; }
.portfolio-up { color:#ff8197; }
.portfolio-down { color:#80baff; }
.portfolio-allocation-row { display:grid; grid-template-columns:minmax(76px,1fr) minmax(35px,5fr) minmax(58px,auto) minmax(72px,auto); gap:10px; align-items:center; padding:10px 0; font-variant-numeric:tabular-nums; }
.portfolio-allocation-row > span:nth-last-child(-n+2) { text-align:right; }
.portfolio-track { display:block; height:7px; background:#29374a; border-radius:8px; overflow:hidden; }
.portfolio-track i { display:block; height:100%; border-radius:inherit; background:hsl(var(--bar-hue) 78% 63%); }
.portfolio-table-scroll { overflow-x:auto; }
.portfolio-page table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; white-space:nowrap; }
.portfolio-page th,.portfolio-page td { padding:11px 9px; border-bottom:1px solid var(--portfolio-edge); text-align:right; }
.portfolio-page th { color:var(--portfolio-muted); font-size:12px; }
.portfolio-page td:first-child,.portfolio-page th:first-child { text-align:left; }
.portfolio-page td:nth-child(3),.portfolio-page th:nth-child(3) { text-align:left; }
.portfolio-page button,.portfolio-page input:not([type=checkbox]),.portfolio-page textarea,.portfolio-page select,.profit-chart-switch button { background:#1c2940; color:#eef4ff; border:1px solid #455c80; border-radius:8px; padding:8px 11px; font:inherit; }
.portfolio-page button:disabled { opacity:.5; cursor:default; }
.portfolio-page form,.portfolio-filters,.portfolio-paging { display:flex; flex-wrap:wrap; gap:8px; align-items:start; margin:14px 0; }
.portfolio-page textarea { flex:1 1 220px; min-height:68px; }
.portfolio-note { display:grid; grid-template-columns:max-content 1fr max-content; gap:12px; align-items:start; border-top:1px solid var(--portfolio-edge); padding:12px 0; }
.portfolio-note p { white-space:pre-wrap; overflow-wrap:anywhere; }
.portfolio-page .portfolio-memo { max-width:140px; overflow:hidden; text-overflow:ellipsis; }
.portfolio-page .portfolio-empty { padding:12px 0; }
.portfolio-paging { justify-content:center; align-items:center; }
.profit-chart-switch { display:flex; gap:6px; }
.profit-chart-switch button[aria-pressed=true] { background:#514079; border-color:#aa91e0; }
body[data-active-view=profits] #profit-summary { gap:10px; background:none; }
body[data-active-view=profits] #profit-summary article, body[data-active-view=reports] #asset-report-summary article { background:#151d2b; border:1px solid #2b394e; border-radius:10px; }
body[data-active-view=reports] #asset-report-summary { gap:8px; background:transparent; }
@media(max-width:600px) {
  .portfolio-heading { align-items:flex-start; }
  .portfolio-allocation-row { grid-template-columns:minmax(74px,1fr) 2fr auto; }
  .portfolio-allocation-row > span:last-child { display:none; }
  .portfolio-note { grid-template-columns:minmax(0,1fr) auto; }
  .portfolio-note p { grid-column:1/-1; grid-row:2; }
}
.flow-terminal #overview [data-protect-symbol] { margin-inline-start:5px; padding:5px 7px; border:1px solid #466080; }
.flow-terminal #overview [data-protect-symbol][aria-checked=true] { background:#184738; color:#b6ffe2; border-color:#4baf85; }
.portfolio-report-detail { margin:12px 0; padding:12px; border:1px solid #2b394e; border-radius:10px; }
.portfolio-report-detail summary { cursor:pointer; font-weight:750; padding:8px; }
.portfolio-report-detail .panel { margin:8px 0 0; }
