:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-deep: #f7f8fa;
  --panel: #f1f3f7;
  --panel-soft: #f7f8fa;
  --line: #d6dbe3;
  --line-soft: #e5e8ed;
  --text: #191c22;
  --muted: #535c69;
  --muted-2: #626c79;
  --green: #1e6d52;
  --red: #a34560;
  --blue: #253fc7;
  --blue-soft: #edf1ff;
  --green-soft: #edf7f2;
  --red-soft: #fcf0f2;
  --accent-fill: #253fc7;
  --accent-text: #ffffff;
  --chart-portfolio: #253fc7;
  --chart-ahlyx: #098577;
  --chart-aqmix: #6b7481;
  --chart-grid: #d6dce6;
  --empty-cell: #f3f5f8;
  --stripe: #f8f9fb;
  --track: #e4e8f0;
  --managed-monthly-positive-rgb: 37,63,199;
  --managed-monthly-negative-rgb: 83,92,105;
  --font-ui: "Roboto", Arial, sans-serif;
  --font-display: "League Gothic", "Arial Narrow", sans-serif;
  --content-width: 1480px;
  --sticky-height: 108px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d0f;
  --bg-deep: #12161a;
  --panel: #12161a;
  --panel-soft: #101419;
  --line: #26303a;
  --line-soft: #1d252d;
  --text: #edf1f7;
  --muted: #d7dee7;
  --muted-2: #ced8e2;
  --green: #b5d4ff;
  --red: #eee3d4;
  --blue: #bfdcff;
  --blue-soft: #182433;
  --green-soft: #182433;
  --red-soft: #24221f;
  --accent-fill: #23384f;
  --accent-text: #d2e1f5;
  --chart-portfolio: #bfdcff;
  --chart-ahlyx: #eee3d4;
  --chart-aqmix: #b6c2cf;
  --chart-grid: #25303a;
  --empty-cell: #15191e;
  --stripe: #11161b;
  --track: #202932;
  --managed-monthly-positive-rgb: 181,212,255;
  --managed-monthly-negative-rgb: 238,227,212;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--sticky-height) + 24px); }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font: 14px/1.5 var(--font-ui); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; text-transform: uppercase; }
h2 { font-size: 28px; }
h3 { font: 600 18px/1.3 var(--font-ui); text-transform: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
button, a, input, select { touch-action: manipulation; }
[hidden] { display: none !important; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.band-inner, .band { width: min(var(--content-width), calc(100% - 64px)); margin-inline: auto; }
.band { padding: 32px 0; }
.app-shell { width: 100%; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--bg); color: var(--blue); }
.skip-link:focus { top: 10px; }

.site-header { position: relative; z-index: 60; background: #111215; color: white; }
.site-header-inner { width: min(var(--content-width), calc(100% - 64px)); height: 78px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #383a40; }
.site-brand { font-family: var(--font-display); font-size: 32px; line-height: 1; display: flex; align-items: center; gap: 18px; }
.site-brand span { max-width: 100px; padding-left: 18px; border-left: 1px solid #777b83; font: 11px/1.5 var(--font-ui); text-transform: uppercase; }
.site-links { display: flex; align-items: center; gap: 32px; font-size: 12px; font-weight: 600; }
.site-links > a:hover { text-decoration: underline; text-underline-offset: 5px; }
#nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: #fafafa; color: #17191d; }
#nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#theme-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #62676e; background: transparent; color: white; }
#theme-toggle:hover { background: #2a2e34; }
#theme-toggle:focus-visible { outline-color: white; }
#theme-toggle svg { grid-area: 1 / 1; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme-toggle .theme-sun, [data-theme="dark"] #theme-toggle .theme-moon { display: none; }
[data-theme="dark"] #theme-toggle .theme-sun { display: block; }
.nav-rail { position: fixed; z-index: 70; top: 78px; right: 0; width: min(360px, 100%); max-height: calc(100dvh - 78px); overflow-y: auto; padding: 24px; background: #111215; color: white; box-shadow: -8px 12px 28px #15182026; }
.nav-brand { display: none; }
.nav-links { display: grid; }
.nav-link { min-height: 44px; display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-bottom: 1px solid #363940; font-size: 13px; }
.nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav-link.active, .nav-link:hover { background: #2a3040; }

.portfolio-masthead { background: #111215; color: #fff; padding: 24px 0; }
.masthead-eyebrow { margin-bottom: 10px; color: #bac3d5; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.portfolio-masthead h1 { font-size: 48px; }
.masthead-description { margin-top: 12px; color: #dce0e7; font-size: 15px; }
.masthead-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 16px; color: #b9c0ce; font-size: 12px; }
.masthead-meta b { margin-left: 8px; font-weight: 500; color: white; }
.portfolio-navigation { position: sticky; top: 0; z-index: 40; background: var(--bg); box-shadow: 0 2px 0 #1720350a; }
.macro-portfolio-selector { height: 64px; display: flex; align-items: center; gap: 24px; }
.macro-portfolio-selector > span:first-child { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.macro-portfolio-selector .range-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 435px; border: 1px solid var(--line); }
.range-button { min-height: 42px; padding: 8px 16px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; transition: background 120ms ease, color 120ms ease; }
.range-button:hover { background: var(--blue-soft); color: var(--blue); }
.range-button.active { background: var(--accent-fill); color: var(--accent-text); }
.macro-portfolio-selector .selected-portfolio { margin-left: auto; color: var(--muted); font-size: 13px; }
.section-navigation { background: var(--accent-fill); color: var(--accent-text); }
.section-navigation .band-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-navigation a { display: grid; place-items: center; min-height: 44px; padding: 10px 8px; border-right: 1px solid #ffffff36; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.section-navigation a:first-child { border-left: 1px solid #ffffff36; }
.section-navigation a:hover { background: #ffffff15; }
.section-navigation a[aria-current] { background: #111215; }
.section-navigation a:focus-visible { outline-color: white; outline-offset: -5px; }

[data-theme="dark"] .site-header,
[data-theme="dark"] .portfolio-masthead,
[data-theme="dark"] .nav-rail { background: var(--panel); color: var(--text); }
[data-theme="dark"] .site-header-inner,
[data-theme="dark"] .site-brand span,
[data-theme="dark"] .nav-link { border-color: var(--line); }
[data-theme="dark"] .masthead-eyebrow,
[data-theme="dark"] .masthead-meta { color: var(--muted); }
[data-theme="dark"] .masthead-description,
[data-theme="dark"] .masthead-meta b { color: var(--text); }
[data-theme="dark"] #nav-toggle,
[data-theme="dark"] #theme-toggle { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
[data-theme="dark"] #nav-toggle:hover,
[data-theme="dark"] #theme-toggle:hover { background: var(--blue-soft); }
[data-theme="dark"] #theme-toggle:focus-visible { outline-color: var(--blue); }
[data-theme="dark"] .nav-link.active,
[data-theme="dark"] .nav-link:hover { background: var(--blue-soft); }
[data-theme="dark"] .section-navigation { background: var(--panel); color: var(--muted); }
[data-theme="dark"] .section-navigation a { border-color: var(--line); }
[data-theme="dark"] .section-navigation a:hover { background: var(--blue-soft); color: var(--text); }
[data-theme="dark"] .section-navigation a[aria-current] { background: var(--accent-fill); color: var(--accent-text); }
[data-theme="dark"] .section-navigation a[aria-current]:focus-visible { outline-color: var(--accent-text); }
[data-theme="dark"] .chart-tooltip { background: var(--panel); color: var(--text); border-color: var(--line); }

.portfolio-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; border-bottom: 1px solid var(--line); }
.portfolio-overview > div { min-width: 0; }
.portfolio-facts { padding-left: 32px; border-left: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.section-kicker { margin-bottom: 8px; font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; }
.asof-label, .coverage-note, .quote-note, .allocation-note { color: var(--muted); font-size: 12px; }
.asof-label { text-align: right; }
.book-live { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 20px 0 22px; }
.live-primary { display: grid; gap: 4px; }
.live-primary > span { color: var(--muted); font-size: 13px; }
.live-primary strong { color: var(--text); font-size: 30px; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; margin: 0; }
.facts-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.facts-grid dt { color: var(--muted); font-size: 12px; }
.facts-grid dd { margin: 0; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

.performance-panel { padding-top: 32px; padding-bottom: 32px; }
.live-readout { margin: -12px 0 24px; }
.performance-comparison { margin: 0 0 28px; width: 100%; }
.comparison-head, .comparison-row { display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(95px, 1fr)); align-items: center; }
.comparison-head { min-height: 44px; padding: 10px 18px; color: var(--muted); background: var(--panel); font-size: 12px; font-weight: 500; }
.comparison-head span:not(:first-child) { text-align: right; }
.comparison-row { min-height: 52px; padding: 12px 16px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.comparison-row.is-portfolio { background: var(--blue-soft); border-left-color: var(--blue); }
.comparison-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.comparison-name i { width: 7px; height: 7px; background: var(--blue); flex: 0 0 7px; border-radius: 50%; }
[data-stats-series="ahlyx"] .comparison-name i { background: var(--chart-ahlyx); }
.comparison-stat { text-align: right; min-width: 0; }
.comparison-stat span { display: none; }
.comparison-stat strong { font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.chart-title { display: grid; gap: 5px; }
.chart-title strong { font: 600 18px/1.3 var(--font-ui); text-transform: none; }
.chart-title > span { color: var(--muted); font-size: 12px; }
.chart-controls { display: flex; align-items: center; gap: 20px; }
.chart-span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chart-controls .range-control { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.chart-controls .range-button { padding-inline: 15px; min-height: 36px; }
.history-chart { position: relative; width: 100%; min-height: 260px; }
.history-chart svg { display: block; width: 100%; height: auto; }
.history-chart text { fill: var(--muted); font-family: var(--font-ui); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 22px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 8px; }
.chart-legend i { width: 22px; height: 3px; background: var(--blue); }
.chart-legend span:nth-child(2) i { background: var(--chart-ahlyx); }
.chart-legend span:nth-child(3) i { background: var(--chart-aqmix); }
.chart-tooltip { display: none; position: absolute; z-index: 5; max-width: min(270px, calc(100% - 24px)); padding: 14px 16px; background: #111820; color: white; border: 1px solid #3d454f; box-shadow: 0 8px 24px #10182921; pointer-events: none; font-size: 12px; }
.chart-tooltip.show { display: block; }
.chart-tooltip-date { display: block; padding-bottom: 9px; border-bottom: 1px solid #ffffff36; margin-bottom: 8px; }
.chart-tooltip-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 8px; }
.chart-tooltip-row i { width: 7px; height: 7px; border-radius: 50%; }
.chart-tooltip-row strong { font-variant-numeric: tabular-nums; }

.managed-monthly { margin-top: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.managed-section-head h2, .managed-breakdown-head h2, .factor-analytics__head h2 { font-size: 28px; }
.managed-section-head p, .managed-breakdown-head p, .factor-analytics__head p { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.6; }
.managed-history-span { color: var(--muted); font-size: 12px; }
.managed-heatmap-scroll { max-height: none; padding: 8px 0; }
.managed-monthly-grid { min-width: 920px; }
.managed-heatmap-row { grid-template-columns: 52px repeat(12, minmax(46px, 1fr)) 66px; gap: 5px; }
.managed-heatmap-label { font-size: 11px; font-weight: 600; }
.managed-heatmap-year, .managed-heatmap-total { font-size: 12px; font-weight: 600; }
.managed-heatmap-cell { height: 36px; border-radius: 0; font-size: 12px; font-weight: 500; }
.managed-heatmap-cell.is-empty { background: var(--empty-cell); border-color: var(--line-soft); }
.managed-monthly .managed-heatmap-total.positive { color: var(--blue) !important; }
.managed-monthly .managed-heatmap-total.negative { color: var(--red) !important; }

.allocation-panel { border-bottom: 1px solid var(--line); }
.allocation-summary { display: flex; gap: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.allocation-summary strong { color: var(--blue); font-weight: 600; }
.allocation-note { margin: -10px 0 25px; }
.allocation-note span { color: var(--text); font-weight: 600; }
.allocation-mosaic { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.asset-tile { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: left; border-radius: 0; transition: border-color 140ms ease, background 140ms ease; }
.asset-tile:hover { border-color: var(--blue); background: var(--bg-deep); }
.asset-tile-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-tile-heading strong { font-size: 15px; font-weight: 700; }
.asset-tile-heading small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.asset-tile .asset-weight { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; font-weight: 500; }
.asset-tile .asset-day { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.asset-day small { color: var(--muted); font-size: 10px; }
.sector-allocation { margin-top: 36px; }
.sector-allocation-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.sector-allocation-head strong { font: 600 18px/1.3 var(--font-ui); text-transform: none; }
.sector-allocation-head > span { color: var(--muted); font-size: 12px; }
.sector-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.sector-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.sector-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sector-row b { font-variant-numeric: tabular-nums; font-weight: 500; }
.sector-track { display: block; grid-column: 1/-1; height: 5px; background: var(--track); }
.sector-track i { display: block; height: 100%; background: var(--blue); }

.managed-breakdown { border-bottom: 1px solid var(--line); }
.managed-table-tools { gap: 10px; }
.managed-search { width: 230px; }
.managed-search input, .managed-sector-select, .managed-export { min-height: 44px; border-radius: 0; font-size: 12px; background: var(--bg); }
.managed-export { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.managed-export:hover { background: var(--accent-fill); color: var(--accent-text); }
.managed-sector-select { width: 175px; }
.managed-table-summary { font-size: 12px; font-weight: 400; padding-block: 14px; }
.managed-table-scroll { max-height: 760px; }
.managed-breakdown table { min-width: 1030px; }
.managed-breakdown thead { background: var(--panel); }
 .managed-breakdown th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 14px; }
.managed-breakdown td { font-size: 13px; padding: 16px 14px; }
.managed-breakdown .ticker-cell { font-size: 14px; }
.managed-breakdown th:first-child, .managed-breakdown td:first-child { padding-left: 14px; }
.managed-breakdown th:nth-child(1) { width: 100px; }
.managed-breakdown th:nth-child(2) { width: 160px; }
.managed-breakdown th:nth-child(3) { width: 205px; }
.managed-breakdown th:nth-child(n + 4), .managed-breakdown td:nth-child(n + 4) { text-align: right; }
.managed-breakdown tbody tr:nth-child(even) { background: var(--stripe); }
.managed-breakdown tbody tr:hover { background: var(--blue-soft); }
 .managed-sort.active { color: var(--blue); text-decoration: underline; text-underline-offset: 5px; }
 .managed-sort:focus-visible { outline-color: var(--blue); }

.factor-analytics { border-top: 0; border-bottom: 1px solid var(--line); }
.factor-analytics__head { grid-template-columns: 1fr; gap: 20px; }
.factor-analytics__tabs { width: max-content; max-width: 100%; padding: 0; border-radius: 0; background: var(--bg); }
.factor-analytics__tab { min-height: 42px; padding-inline: 18px; border-radius: 0; font-size: 13px; font-weight: 500; }
.factor-analytics__tab.is-active { background: var(--accent-fill); color: var(--accent-text); box-shadow: none; }
.factor-analytics__stage { min-height: 0; }
.factor-analytics__panel-head { margin-top: 24px; }
.factor-analytics__panel-head h3 { font-size: 18px; font-weight: 600; }
.factor-analytics__panel-head p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.mini-pill { display: inline-block; padding: 6px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.factor-chart-surface { border-bottom: 0; min-height: 280px; padding-block: 25px; }
.factor-active-row { grid-template-columns: 190px minmax(0, 1fr) 110px; gap: 28px; padding-block: 10px; }
.factor-active-label strong { font-size: 14px; }
.factor-active-label span { font-size: 12px; }
.factor-active-value { font-size: 14px; }
.factor-active-legend { font-size: 12px; }
.factor-chart-axis { font-family: var(--font-ui); fill: var(--muted); font-weight: 400; }
.factor-chart-grid { stroke: var(--chart-grid); }
.factor-waterfall-total { fill: var(--blue); }
.factor-waterfall-positive { fill: var(--green); }
.factor-waterfall-negative { fill: var(--red); }
.factor-drawdown-benchmark { stroke: var(--chart-ahlyx); }
.factor-drawdown-stat span { font-size: 11px; font-weight: 500; }
.factor-drawdown-stat strong { font-size: 23px; font-weight: 500; }
.rebalance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-bottom: 24px; }
.rebalance-stat { display: grid; gap: 7px; padding: 18px; border-right: 1px solid var(--line); }
.rebalance-stat:first-child { padding-left: 0; }
.rebalance-stat:last-child { border-right: 0; }
.rebalance-stat > span { font-size: 12px; color: var(--muted); }
.rebalance-stat strong { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rebalance-legend { display: flex; justify-content: space-between; gap: 16px; padding-block: 14px; font-size: 12px; color: var(--muted); }
.rebalance-recent { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.rebalance-month { display: grid; gap: 5px; padding: 18px 8px; }
.rebalance-month b, .rebalance-month span { font-size: 11px; color: var(--muted); font-weight: 400; }
.rebalance-month strong { font-weight: 500; }
.footer-note { color: var(--muted); font-size: 12px; }
.footer-brand { font: 32px/1.1 var(--font-display); color: var(--text); margin-bottom: 20px; }
.footer-note p { max-width: 1020px; margin-bottom: 10px; }
.footer-note #generated-at { display: block; margin-top: 24px; color: var(--muted-2); }
.loading-block { display: grid; gap: 14px; width: 100%; padding-block: 20px; }
.skeleton-line { height: 36px; background: var(--panel); }
.history-loading, .empty-state, .error-state { display: grid; place-items: center; min-height: 220px; text-align: center; padding: 24px; color: var(--muted); font-size: 14px; }
.error-state { color: var(--red); }

@media (min-width: 1600px) {
  .band-inner, .band, .site-header-inner { width: min(var(--content-width), calc(100% - 64px)); }
}
@media (max-width: 1100px) {
  .band-inner, .band, .site-header-inner { width: calc(100% - 64px); }
  .portfolio-overview { gap: 30px; }
  .portfolio-facts { padding-left: 30px; }
  .facts-grid { grid-template-columns: 1fr; }
  .portfolio-masthead h1 { font-size: 48px; }
  .comparison-head, .comparison-row { grid-template-columns: minmax(155px, 1.4fr) repeat(5, minmax(80px, 1fr)); }
  .comparison-head { font-size: 10px; }
  .comparison-stat strong { font-size: 15px; }
  .chart-controls { gap: 10px; }
  .chart-span { display: none; }
  .managed-breakdown-head { grid-template-columns: 1fr; gap: 22px; }
  .allocation-mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .managed-table-tools { width: 100%; }
}
@media (max-width: 760px) {
  :root { --sticky-height: 138px; }
  .band-inner, .band, .site-header-inner { width: calc(100% - 32px); }
  .band { padding-block: 32px; }
  h2, .managed-section-head h2, .managed-breakdown-head h2, .factor-analytics__head h2 { font-size: 28px; }
  .site-header-inner { height: 68px; }
  .site-brand { font-size: 29px; gap: 12px; }
  .site-brand span { padding-left: 12px; font-size: 9px; }
  .site-links { gap: 8px; }
  .site-links > a { display: none; }
  #nav-toggle { width: 38px; height: 38px; }
  #theme-toggle { width: 38px; height: 38px; flex-basis: 38px; }
  .nav-rail { top: 68px; max-height: calc(100dvh - 68px); }
  .portfolio-masthead { padding-block: 30px; }
  .portfolio-masthead h1 { font-size: 38px; max-width: 440px; }
  .masthead-eyebrow { font-size: 10px; margin-bottom: 12px; }
  .masthead-description { font-size: 15px; max-width: 330px; }
  .masthead-meta { gap: 7px 18px; margin-top: 18px; font-size: 11px; }
  .macro-portfolio-selector { height: 94px; flex-wrap: wrap; gap: 6px; align-content: center; }
  .macro-portfolio-selector > span:first-child { font-size: 10px; flex-basis: 100%; }
  .macro-portfolio-selector .range-control { width: 100%; }
  .macro-portfolio-selector .selected-portfolio { display: none; }
  .macro-portfolio-selector button { min-height: 42px; padding: 8px 5px; font-size: 12px; }
  .section-navigation .band-inner { width: 100%; }
  .section-navigation a { min-height: 44px; font-size: 11px; }
  .portfolio-overview { grid-template-columns: 1fr; gap: 30px; }
  .portfolio-facts { padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .section-head { margin-bottom: 20px; }
  .asof-label { font-size: 10px; max-width: 105px; }
  .book-live { gap: 15px; margin-top: 10px; }
  .live-primary strong { font-size: 30px; }
  .facts-grid { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .facts-grid > div { display: grid; gap: 4px; }
  .facts-grid dd { font-size: 17px; }
  .comparison-head { display: none; }
  .comparison-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; padding: 18px 12px; }
  .comparison-name { grid-column: 1/-1; font-size: 14px; margin-bottom: 2px; }
  .comparison-stat { text-align: left; }
  .comparison-stat span { display: block; margin-bottom: 3px; font-size: 9px; color: var(--muted); font-weight: 500; }
  .comparison-stat strong { font-size: 16px; }
  .performance-comparison { margin-bottom: 32px; }
  .chart-toolbar { align-items: start; flex-direction: column; gap: 18px; }
  .chart-title strong { font-size: 18px; }
  .chart-controls, .chart-controls .range-control { width: 100%; }
  .history-chart { min-height: 240px; }
  .history-chart svg { height: auto; min-height: 240px; }
  .chart-legend { gap: 12px 20px; margin-top: 12px; font-size: 11px; }
  .chart-tooltip { font-size: 11px; padding: 10px; }
  .managed-section-head, .managed-breakdown-head { gap: 12px; }
  .managed-section-head p, .managed-breakdown-head p, .factor-analytics__head p { font-size: 12px; }
  .allocation-panel > .section-head { align-items: start; flex-direction: column; gap: 12px; }
  .allocation-note { margin-top: -6px; font-size: 11px; }
  .allocation-summary { font-size: 12px; }
  .allocation-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .asset-tile { padding: 12px 10px; gap: 9px; }
  .asset-tile-heading { flex-wrap: wrap; gap: 4px; }
  .asset-tile-heading strong { font-size: 13px; }
  .asset-tile-heading small { font-size: 10px; }
  .asset-tile .asset-weight { font-size: 19px; }
  .asset-tile .asset-day { flex-direction: column; align-items: start; gap: 2px; }
  .sector-allocation-head { flex-direction: column; gap: 8px; }
  .sector-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .managed-search, .managed-sector-select { width: 100%; }
  .managed-table-tools { grid-template-columns: 1fr 1fr; }
  .managed-table-summary { gap: 6px; font-size: 11px; }
  .factor-analytics__tabs { width: 100%; }
  .factor-analytics__tab { padding-inline: 14px; font-size: 12px; }
  .factor-analytics__panel-head h3 { font-size: 18px; }
  .factor-analytics__panel-head p { font-size: 12px; }
  .factor-active-row { grid-template-columns: 105px minmax(0, 1fr) 65px; gap: 12px; }
  .factor-active-label strong, .factor-active-value { font-size: 12px; }
  .factor-active-legend { font-size: 11px; }
  .factor-chart-surface { min-height: 240px; }
  .factor-analytics__stage { min-height: 0; }
  .rebalance-summary { grid-template-columns: repeat(2, 1fr); }
  .rebalance-stat:nth-child(3) { padding-left: 0; }
  .rebalance-stat:nth-child(2) { border-right: 0; }
  .rebalance-recent { grid-template-columns: repeat(3, 1fr); }
  .rebalance-legend { flex-direction: column; gap: 6px; }
}
@media (max-width: 360px) {
  .site-brand span { display: none; }
  .allocation-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-masthead h1 { font-size: 38px; }
  .macro-portfolio-selector button { font-size: 11px; }
  .comparison-stat strong { font-size: 14px; }
  .live-primary strong { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Match the equity beta page's readable table signals and restrained controls. */
[data-theme="dark"] .managed-breakdown { --green: #c5e0ff; --red: #f3e9db; }
[data-stats-series="aqmix"] .comparison-name i { background: var(--chart-aqmix); }
#nav-toggle { width: 42px; height: 42px; border: 1px solid #62676e; background: transparent; color: white; }
#theme-toggle { width: 42px; height: 42px; flex-basis: 42px; }
.comparison-row:not(.is-portfolio):nth-child(odd) { background: var(--stripe); }
.comparison-row:hover { background: var(--blue-soft); }
.managed-breakdown td { font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  #nav-toggle, #theme-toggle { width: 38px; height: 38px; flex-basis: 38px; }
  .comparison-stat span { font-size: 11px; }
}

/* Rounded monthly cells with the correlation matrix's stronger diverging fills. */
.managed-monthly .managed-heatmap-cell { border-radius: 10px; }
[data-theme="dark"] .managed-monthly .managed-heatmap-cell:not(.is-empty) {
  --managed-monthly-alpha: clamp(.08, calc(.08 + var(--monthly-magnitude, 0) * 1.28), .72);
  border-color: var(--line) !important;
}
