/* A sector-only addition to the approved portfolio betas. */
/* Let the sector column set the desktop row height, then fill it with the
   scrollable holdings. Size containment keeps hundreds of cards from making
   the entire page tall while allowing the bottom edges to stay aligned. */
@media (min-width:761px) {
 html:root body:is(.portfolio-profile,.daily-profile) .profile-allocation-grid:has(.profile-ui-sector-donut-content:not([hidden])) { align-items:stretch; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-allocation-grid:has(.profile-ui-sector-donut-content:not([hidden])) > .profile-original-allocation { display:flex; flex-direction:column; min-height:0; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-allocation-grid:has(.profile-ui-sector-donut-content:not([hidden])) :is(#allocation-mosaic,#portfolio-list) { flex:1 1 0; contain:size; min-height:360px; max-height:none; }
}
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut {
 --sector-0:var(--blue); --sector-1:var(--chart-ahlyx); --sector-2:var(--chart-aqmix);
 --sector-3:color-mix(in srgb,var(--blue) 70%,var(--bg));
 --sector-4:color-mix(in srgb,var(--chart-ahlyx) 70%,var(--bg));
 --sector-5:color-mix(in srgb,var(--chart-aqmix) 68%,var(--bg));
 --sector-6:color-mix(in srgb,var(--blue) 76%,var(--chart-ahlyx));
 --sector-7:color-mix(in srgb,var(--chart-ahlyx) 65%,var(--chart-aqmix));
 --sector-8:color-mix(in srgb,var(--blue) 48%,var(--text));
 --sector-9:color-mix(in srgb,var(--chart-ahlyx) 45%,var(--text));
 --sector-10:color-mix(in srgb,var(--blue) 45%,var(--bg));
 --sector-11:var(--muted);
 container-type:inline-size; margin-top:30px; padding-top:24px; border-top:1px solid var(--rp-line); font-family:var(--font-ui); color:var(--rp-text);
}
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut-head { display:flex; align-items:start; justify-content:space-between; gap:16px; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut h4 { margin:0; font:500 18px/1.35 var(--font-ui); letter-spacing:-.015em; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut-head p { margin:7px 0 0; color:var(--rp-muted); font:400 12px/1.6 var(--font-ui); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-reset { display:inline-flex; flex-shrink:0; align-items:center; gap:10px; min-height:38px; padding:8px 12px; border:1px solid var(--rp-line); border-radius:20px; background:transparent; color:var(--rp-text); font:500 12px/1.4 var(--font-ui); cursor:pointer; transition:opacity 220ms ease-in-out,background 220ms ease-in-out; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-reset:disabled { opacity:.35; cursor:default; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-reset:not(:disabled):hover { background:var(--rp-soft); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-reset span { font-size:17px; line-height:1; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut-content { display:grid; grid-template-columns:minmax(190px,1fr) minmax(180px,1fr); gap:8px 16px; align-items:center; padding:18px 0 12px; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-plot { position:relative; width:100%; max-width:320px; justify-self:center; aspect-ratio:1; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-plot svg { display:block; width:100%; height:100%; overflow:visible; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-track { stroke:var(--rp-line); opacity:.45; transition:opacity 680ms ease-in-out; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut[data-focused="true"] .profile-ui-sector-track { opacity:0; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-slices path { fill:var(--sector-color); cursor:pointer; outline:0; touch-action:manipulation; transition:fill 240ms ease-in-out,filter 180ms ease-in-out; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-slices path:is(.is-hovered,:focus-visible) { filter:brightness(1.12); stroke:var(--rp-text); stroke-width:1.4; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-center { position:absolute; inset:26%; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:7px; pointer-events:none; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-center span { max-width:100%; font:500 12px/1.3 var(--font-ui); color:var(--rp-muted); overflow-wrap:anywhere; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-center strong { font:500 clamp(22px,5cqi,28px)/1.05 var(--font-ui); letter-spacing:-.035em; font-variant-numeric:tabular-nums; color:var(--rp-text); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-center small { font:400 11px/1.4 var(--font-ui); color:var(--rp-muted); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-legend { display:grid; align-content:center; min-width:0; gap:2px; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item { display:grid; grid-template-columns:7px minmax(0,1fr) auto; align-items:center; gap:9px; min-height:34px; padding:7px 8px; border:0; border-radius:8px; text-align:left; background:transparent; color:var(--rp-muted); font:400 12px/1.4 var(--font-ui); cursor:pointer; transition:background 220ms ease-in-out,color 220ms ease-in-out; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item i { width:7px; height:7px; border-radius:50%; background:var(--sector-color); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item span { min-width:0; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item b { color:var(--rp-text); font:500 12px/1.4 var(--font-ui); font-variant-numeric:tabular-nums; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item:is(.is-hovered,[aria-pressed="true"]) { background:var(--rp-soft); color:var(--rp-text); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut :is(button,path):focus-visible { outline:2px solid var(--rp-blue); outline-offset:3px; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut path:focus-visible { outline:0; stroke-width:2.5; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-note { min-height:38px; margin:4px 0 0; font:400 12px/1.6 var(--font-ui); color:var(--rp-muted); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-empty { margin:24px 0 0; font:400 13px/1.6 var(--font-ui); color:var(--rp-muted); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-announcement { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@container (max-width:460px) {
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut-content { grid-template-columns:minmax(0,1fr); gap:12px; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-plot { max-width:300px; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-legend { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item { grid-template-columns:7px minmax(0,1fr); min-height:44px; gap:3px 8px; }
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item b { grid-column:2; }
}
@media(prefers-reduced-motion:reduce) {
 html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-donut * { transition:none!important; }
}

/* The daily portfolio now shares the same allocation layout as the other portfolios. */
html:root body.daily-profile #allocations .profile-allocation-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:64px; margin-top:26px; }
html:root body.daily-profile #allocations .rp-panel-head { align-items:start; }
html:root body.daily-profile #allocations .profile-original-allocation { min-width:0; }
html:root body.daily-profile #allocations .rp-sector-allocation { margin:0; padding:0; }
html:root body.daily-profile #allocations .rp-sector-heading strong { font:600 20px/1.35 var(--font-ui); letter-spacing:-.02em; }
html:root body.daily-profile #allocations .rp-sector-heading > span { color:var(--rp-muted); font:400 12px/1.5 var(--font-ui); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item:disabled { opacity:.6; cursor:default; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-sector-item:disabled i { background:transparent; box-shadow:inset 0 0 0 1px var(--rp-muted); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-original-allocation > .profile-ui-allocation-note { flex-shrink:0; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-position-details { margin-top:28px; padding-top:22px; border-top:1px solid var(--rp-line); }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-position-details .rp-exposure-foot { margin:0 0 24px; padding:0 0 20px; border-top:0; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-position-details .rp-signal-meta { border:0; padding-top:0; }
html:root body:is(.portfolio-profile,.daily-profile) .profile-ui-position-details .rp-source-status { margin:12px 0 0; padding:12px 0 0; border-top:1px solid var(--rp-line); }
html:root body.daily-profile #allocations [hidden] { display:none!important; }
@media(max-width:1000px) {
 html:root body.daily-profile #allocations .profile-allocation-grid { gap:32px; }
}
@media(max-width:760px) {
 html:root body.daily-profile #allocations .profile-allocation-grid { grid-template-columns:minmax(0,1fr); }
}
