/* Shared holdings and position ledgers. Monthly heatmaps keep their own design. */
@font-face {
  font-family: "Geist";
  src: url("fonts/portfolio-font-preview/geist-9b6f5ff45b.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

html:root body table.portfolio-data-table {
  --pt-bg: var(--ct-bg, #0a0e0f);
  --pt-ink: #e5e9ed;
  --pt-muted: #94a1aa;
  --pt-line: #253038;
  --pt-hover: #0e1416;
  --pt-hover: color-mix(in srgb, #151e23 35%, var(--pt-bg));
  --pt-positive: #9fbea9;
  --pt-negative: #d1a298;
  width: 100%;
  border-collapse: collapse;
  font: 400 14px/1.5 "Geist", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--pt-ink);
  background: var(--pt-bg);
}
html:root[data-theme="light"] body table.portfolio-data-table {
  --pt-ink: #252724;
  --pt-muted: #72736e;
  --pt-line: #e3e0da;
  --pt-hover: #f8f6f3;
  --pt-hover: color-mix(in srgb, #f1efeb 35%, var(--pt-bg));
  --pt-positive: #486752;
  --pt-negative: #915647;
}
html:root body table.portfolio-data-table :is(thead, th) { background: var(--pt-bg); }
html:root body table.portfolio-data-table :is(th, td) {
  box-sizing: border-box;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--pt-line);
  text-align: left;
  vertical-align: middle;
  color: var(--pt-ink);
  font: inherit;
}
html:root body table.portfolio-data-table th {
  color: var(--pt-muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
html:root body table.portfolio-data-table tbody tr { background: transparent; transition: background-color 160ms ease-out; }
html:root body table.portfolio-data-table tbody tr:hover { background: var(--pt-hover); }
html:root body table.portfolio-data-table :is(th, td):first-child { padding-left: 16px; }
html:root body table.portfolio-data-table :is(th, td):last-child { padding-right: 16px; }
html:root body table.portfolio-data-table :is(.number-cell, .is-number) { text-align: right; white-space: nowrap; }
html:root body table.portfolio-data-table .contribution-cell { font-weight: 500; }
html:root body table.portfolio-data-table .contribution-cell:not(.positive):not(.negative) { color: var(--pt-muted); }
html:root body table.portfolio-data-table td.positive { color: var(--pt-positive); background: transparent; }
html:root body table.portfolio-data-table td.negative { color: var(--pt-negative); background: transparent; }
html:root body table.portfolio-data-table td.position-weight { color: var(--pt-ink); }
html:root body table.portfolio-data-table .portfolio-asset-ticker { display: block; font-size: 15px; font-weight: 600; color: var(--pt-ink); }
html:root body table.portfolio-data-table .portfolio-asset-name { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--pt-muted); overflow-wrap: anywhere; }
html:root body table.portfolio-data-table .portfolio-asset-class { color: var(--pt-muted); }
html:root body table.portfolio-data-table :is(.sort-button, .managed-sort) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
html:root body table.portfolio-data-table :is(.sort-button, .managed-sort):is(.active, :hover) { color: var(--pt-ink); }
html:root body table.portfolio-data-table .portfolio-market-sort { display: inline-block; margin-left: 12px; font-size: 12px; font-weight: 400; }
html:root body table.portfolio-data-table :is(button, a, input):focus-visible { outline: 2px solid var(--pt-muted); outline-offset: 4px; }

html:root body table.portfolio-holdings-table { min-width: 1040px; table-layout: fixed; }
html:root body table.portfolio-holdings-table :is(th, td):nth-child(n + 3):not([colspan]) { text-align: right; }
html:root body table.portfolio-holdings-table th:nth-child(1) { width: 26%; }
html:root body table.portfolio-holdings-table th:nth-child(2) { width: 16%; }
html:root body table.portfolio-holdings-table th:nth-child(3) { width: 12%; }
html:root body table.portfolio-holdings-table th:nth-child(4) { width: 11%; }
html:root body table.portfolio-holdings-table th:nth-child(5) { width: 11%; }
html:root body table.portfolio-holdings-table th:nth-child(6) { width: 14%; }
html:root body table.portfolio-holdings-table th:nth-child(7) { width: 10%; }
html:root body table.portfolio-holdings-table td.ticker-cell { white-space: normal; }

html:root body table.ms-target-table.portfolio-data-table { table-layout: auto; min-width: 1160px; }
html:root body table.ms-target-table.portfolio-data-table[data-mode="futures"] { min-width: 1480px; }
html:root body table.ms-target-table.portfolio-data-table[data-mode="etf"] :is(th, td):nth-child(n + 2),
html:root body table.ms-target-table.portfolio-data-table[data-mode="futures"] :is(th, td):nth-child(n + 4) { text-align: right; }
html:root body table.ms-target-table.portfolio-data-table td:first-child { font-weight: 600; }
html:root body table.ms-target-table.portfolio-data-table :is(td.is-positive, td.is-negative) { color: var(--pt-ink); }
html:root body table.ms-target-table.portfolio-data-table :is(.ms-target-contract-symbol small, .ms-target-residual small) { color: var(--pt-muted); font-weight: 400; }

html:root body .directory-table table.portfolio-data-table :is(th, td):nth-child(n + 3) { text-align: right; }
html:root body .directory-table table.portfolio-data-table td:nth-child(2) { color: var(--pt-muted); }
html:root body .directory-table table.portfolio-data-table :is(td strong, td b) { font-weight: 500; }
html:root body .directory-table table.portfolio-data-table td:first-child :is(strong, b) { font-weight: 600; }

html:root body :is(.managed-table-scroll, .table-scroll):has(> table.portfolio-holdings-table) {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border-color: var(--line, var(--ct-line));
  border-radius: 0;
  overscroll-behavior-x: contain;
}
@media (max-width: 760px) {
  html:root body table.portfolio-data-table :is(th, td) { padding-inline: 12px; }
  html:root body table.portfolio-data-table :is(th, td):first-child { padding-left: 16px; }
  html:root body table.portfolio-data-table :is(th, td):last-child { padding-right: 16px; }
}

/* Portfolio performance comparisons share the same treatment in every family.
   Scope to the performance panel so earlier page-specific mobile rules cannot
   turn the six aligned columns into different layouts. Only this table scrolls. */
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table {
  --pc-ink: #e5e9ed;
  --pc-muted: #94a1aa;
  --pc-line: #253038;
  --pc-hover: #0e1416;
  --pc-hover: color-mix(in srgb, #151e23 35%, var(--rp-bg, var(--ct-bg, #0a0e0f)));
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 0;
  border-top: 1px solid var(--pc-line);
  border-radius: 0;
  background: transparent;
  color: var(--pc-ink);
  font: 400 14px/1.5 "Geist", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
html:root[data-theme="light"] body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table {
  --pc-ink: #252724;
  --pc-muted: #72736e;
  --pc-line: #e3e0da;
  --pc-hover: #f8f6f3;
  --pc-hover: color-mix(in srgb, #f1efeb 35%, var(--rp-bg, var(--ct-bg, #fcfaf7)));
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-head, .comparison-row) {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(210px, 1.8fr) repeat(5, minmax(110px, 1fr));
  align-items: center;
  gap: 0 20px;
  min-width: 920px;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--pc-line);
  border-radius: 0;
  background: transparent;
  color: var(--pc-ink);
  font-family: inherit;
  letter-spacing: 0;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-head {
  min-height: 62px;
  padding-block: 10px;
  color: var(--pc-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: none;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-head > span {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-head > span:first-child { text-align: left; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-period {
  display: block;
  margin-top: 2px;
  color: var(--pc-muted);
  font: 400 11px/1.5 "Geist", Arial, sans-serif;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row {
  min-height: 64px;
  transition: background-color 160ms ease-out;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row:hover { background: var(--pc-hover); }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-name {
  display: flex;
  grid-column: auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: var(--comparison-series, var(--chart-portfolio));
  font: 500 15px/1.5 "Geist", Arial, sans-serif;
  white-space: nowrap;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-name > span { color: inherit; font: inherit; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-name i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--comparison-series, var(--chart-portfolio));
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-stat, .comparison-row > strong:not(:first-child)) {
  min-width: 0;
  text-align: right;
  color: var(--pc-ink);
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-stat > span { display: none; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-stat strong, .comparison-row > strong:not(:first-child)) {
  display: block;
  color: var(--pc-ink);
  font: 400 16px/1.5 "Geist", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row > strong:not(:first-child)::before { display: none; content: none; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row.is-portfolio :is(.comparison-stat strong, strong:not(:first-child)) { font-weight: 500; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row.is-portfolio .comparison-name { font-weight: 600; }
html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table:focus-visible { outline: 2px solid var(--pc-muted); outline-offset: 4px; }

/* Keep row identities in view while phone users scroll the figures. */
@media (max-width: 760px) {
  html:root body table:is(.portfolio-holdings-table, .ms-target-table).portfolio-data-table :is(th, td):first-child:not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--pt-bg);
    box-shadow: 1px 0 0 var(--pt-line);
    transition: background-color 160ms ease-out;
  }
  html:root body table.portfolio-holdings-table th:first-child { width: 14%; }
  html:root body table.ms-target-table.portfolio-data-table :is(th, td):first-child:not([colspan]) { min-width: 110px; }
  html:root body table:is(.portfolio-holdings-table, .ms-target-table).portfolio-data-table tbody tr:hover td:first-child:not([colspan]) { background: var(--pt-hover); }

  html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-head, .comparison-row) {
    grid-template-columns: 140px repeat(5, minmax(110px, 1fr));
  }
  html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-head, .comparison-row) > :first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
    box-sizing: border-box;
    margin: -16px 0 -16px -16px;
    padding: 16px 12px 16px 16px;
    background: var(--rp-bg, var(--ct-bg, #0a0e0f));
    box-shadow: 1px 0 0 var(--pc-line);
    white-space: normal;
    transition: background-color 160ms ease-out;
  }
  html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-row:hover > :first-child { background: var(--pc-hover); }
  html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table .comparison-head > :first-child {
    margin-block: -10px;
    padding-block: 10px;
  }
}

/* Quiet overflow cues stay outside the scrolling content and pinned names. */
html:root body .portfolio-swipe-shell {
  --ps-bg: var(--rp-bg, var(--ct-bg, #0a0e0f));
  --ps-muted: #94a1aa;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
html:root[data-theme="light"] body .portfolio-swipe-shell { --ps-muted: #72736e; }
html:root body .portfolio-swipe-edge {
  position: absolute;
  top: 0;
  right: 0;
  height: var(--ps-scroll-height, 100%);
  z-index: 4;
  width: 24px;
  background: linear-gradient(to right, transparent, var(--ps-bg));
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease-out;
}
html:root body .portfolio-swipe-shell.has-more-columns > .portfolio-swipe-edge { opacity: 1; }
html:root body .portfolio-swipe-hint {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 18px;
  margin-top: 8px;
  color: var(--ps-muted);
  font: 400 12px/1.5 "Geist", Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}
html:root body .portfolio-swipe-shell.has-overflow > .portfolio-swipe-hint { display: flex; }
html:root body .portfolio-swipe-shell.has-more-columns:not(.has-swiped) > .portfolio-swipe-hint { opacity: 1; }
html:root body .portfolio-swipe-hint svg { width: 14px; height: 14px; flex: 0 0 14px; }
@media (prefers-reduced-motion: reduce) {
  html:root body table.portfolio-data-table tbody tr,
  html:root body table.portfolio-data-table :is(th, td):first-child,
  html:root body :is(#performance, #profile-performance, .performance-panel) .performance-comparison.portfolio-comparison-table :is(.comparison-row, .comparison-row > :first-child),
  html:root body :is(.portfolio-swipe-edge, .portfolio-swipe-hint) { transition: none; }
}
