/* /portfolio/: the portfolio tracker and watchlist (sections/portfolio.py, static/portfolio.js).
   Uses biz.css tokens and shared classes; only what's new to this page is here. */
.pf [hidden], .pf-has[hidden], #pf-watch [hidden] { display: none !important; }
.pf-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin: 0 0 10px; }
.pf-bar .pick select { min-width: 240px; font-weight: 600; }
.pf-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-where { margin: 0 0 28px; }
.pf-where + .pf-where { margin-top: -22px; }
.pf-note { margin: 0 0 18px; padding: 10px 12px; background: var(--wash); border-left: 4px solid var(--ink); font-size: 15px; }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; font: 600 14px/1.3 var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { text-decoration-thickness: 2px; }

/* Portfolios: one tab each, square and ink (OTR .sp-chips), "+ New portfolio" last */
.pf-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pf-tabs[hidden] { display: none; }
.pf-tab { appearance: none; font: 600 15px/1.2 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 9px 14px; cursor: pointer; }
.pf-tab span { font-weight: 400; color: var(--quiet); margin-left: 2px; }
.pf-tab:hover { background: var(--wash); }
.pf-tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pf-tab[aria-pressed="true"] span { color: #A8A8A8; }
.pf-tab.pf-tabnew { border-style: dashed; font-weight: 800; }
.pf-manage { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.pf-manage[hidden] { display: none; }
.pf-name { margin: 0; font: 800 26px/1.15 var(--sans); letter-spacing: -.02em; }
.pf-danger { color: var(--down); }
.btn.danger { background: var(--down); color: var(--paper); }
.btn.danger:hover { background: var(--ink); }

/* Empty state: three ways in */
.pf-empty { margin: 8px 0 0; }
.pf-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 14px; }
.pf-start button { appearance: none; text-align: left; border: 2px solid var(--ink); background: var(--paper); padding: 22px; cursor: pointer; display: grid; gap: 8px; color: var(--ink); font: 400 15px/1.45 var(--sans); }
.pf-start button:hover { background: var(--wash); }
.pf-start b { font: 800 20px/1.2 var(--sans); }
.pf-start span { color: var(--quiet); }

/* Totals */
.pf .facts { margin-top: 4px; }
.pf .facts dd.pf-v.up { color: var(--up); }
.pf .facts dd.pf-v.down { color: var(--down); }
.pf .facts dd .chg { display: inline-block; }

/* Holdings table: the header cells are buttons, for sorting */
.pf-tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pf-tbl .tbl thead th { position: static; }
.pf-tbl th button { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.pf-tbl th[aria-sort]::after { content: none; }
.pf-tbl th[aria-sort] button::after { content: " ↓"; }
.pf-tbl th[aria-sort="ascending"] button::after { content: " ↑"; }
.pf-tbl td .sm { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chart and allocation */
.pf-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; align-items: start; }
.pf-two .seg { margin: 0 0 14px; }
.pf-chart { min-height: 300px; }
.pf-chart svg { display: block; overflow: visible; touch-action: pan-y; }
.pf-chart text { font: 400 12px var(--sans); fill: var(--quiet); }
.pf-chart .gr { stroke: var(--rail); }
.pf-chart .zero { stroke: var(--faint); stroke-dasharray: 3 3; }
.pf-chart path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pf-chart path.me { stroke: var(--ink); stroke-width: 2.5; }
.pf-chart path.bm { stroke: #7A7A75; stroke-dasharray: 6 4; }
.pf-chart circle.me { fill: var(--ink); }
.pf-chart circle.bm { fill: #7A7A75; }
.pf-chart .hair { stroke: var(--quiet); stroke-width: 1; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin: 0 0 6px; min-height: 22px; }
.pf-legend span.me::before, .pf-legend span.bm::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: 4px; background: var(--ink); }
.pf-legend span.bm::before { background: repeating-linear-gradient(90deg, #7A7A75 0 6px, transparent 6px 10px); }
.pf-legend b { font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-read { margin: 0 0 4px; min-height: 1.4em; color: var(--quiet); font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; }
.pf-two .pf-ctl .seg { margin: 0; }
.pf-seg { margin: 0 0 12px; }
.pf-alloc { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.pf-alloc li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 56px 70px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rail); font-size: 15px; }
.pf-alloc .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-alloc .bar { display: block; height: 10px; background: var(--wash); }
.pf-alloc .bar i { display: block; height: 100%; }
.pf-alloc .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-alloc .x { text-align: right; color: var(--quiet); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Watchlist */
.pf .tbl-wrap, #pf-watch .tbl-wrap, .pf-tbl { position: relative; }   /* keeps the hidden column labels inside the scroll box */
.pf-watchadd { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 18px; }
.pf-watchadd .fld { min-width: min(320px, 70vw); }
.pf-sugg { position: absolute; z-index: 30; left: 0; top: 100%; margin: 4px 0 0; padding: 0; list-style: none; min-width: min(380px, 90vw); max-height: 320px; overflow-y: auto; background: var(--paper); border: 1px solid var(--ink); }
.pf-sugg button { appearance: none; display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rail); background: var(--paper); padding: 9px 12px; font: 400 14px/1.3 var(--sans); color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-sugg button:hover, .pf-sugg button:focus-visible { background: var(--wash); }
.pf-sugg b { margin-right: 6px; }

/* Dialogs */
.pf-dlg { border: 2px solid var(--ink); border-radius: 0; padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 40px); color: var(--ink); background: var(--paper); }
.pf-dlg::backdrop { background: rgba(0, 0, 0, .45); }
.pf-form { padding: 28px; display: grid; gap: 14px; font-size: 15px; }
.pf-form h2 { font: 800 26px/1.15 var(--sans); letter-spacing: -.01em; }
.pf-form p { margin: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.pf-f { position: relative; display: grid; gap: 5px; font: 600 14px/1.2 var(--sans); min-width: 0; }
.pf-f.pf-wide { grid-column: 1 / -1; }
.pf-f input, .pf-f select, .pf-form textarea { width: 100%; font: 400 16px/1.3 var(--sans); padding: 10px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }
.pf-f input[readonly] { background: var(--wash); }
.pf-f select { appearance: none; -webkit-appearance: none; padding-right: 32px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 11px center; }
.pf-f input:focus, .pf-f select:focus, .pf-form textarea:focus { outline: 3px solid var(--cite); outline-offset: 0; }
.pf-form textarea { font: 400 14px/1.4 ui-monospace, Menlo, monospace; margin: 8px 0; }
.pf-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.pf-btns .danger { margin-left: auto; }
.pf-err { color: var(--down); font-weight: 600; }
.pf-err:empty { display: none; }
.pf-warn { padding: 10px 12px; background: var(--hl); }
.pf-drop { display: grid; place-items: center; gap: 4px; padding: 30px 16px; border: 2px dashed var(--ink); text-align: center; cursor: pointer; }
.pf-drop.on, .pf-drop:hover { background: var(--wash); }
.pf-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pf-drop:focus-within { outline: 3px solid var(--cite); }
.pf-drop b { font-size: 17px; }
.pf-drop span { color: var(--quiet); font-size: 14px; }
.pf-help summary { cursor: pointer; font-weight: 600; list-style: none; }
.pf-help summary::-webkit-details-marker { display: none; }
.pf-help summary::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(-45deg); transition: transform .15s; }
.pf-help[open] summary::before { transform: translateY(-3px) rotate(45deg); }
.pf-help[open] summary { margin-bottom: 10px; }
.pf-help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.pf-prev { max-height: 300px; overflow: auto; border-bottom: 1px solid var(--rail); }
.pf-prev .tbl thead th { position: sticky; top: 0; }
.pf-prev .tbl td { padding-top: 7px; padding-bottom: 7px; }
.pf-check { display: flex; gap: 10px; align-items: flex-start; }
.pf-check input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 2px; }

/* Analysis: cards of figures (number right, label left), contributions as bars either side of zero */
.pf-ana { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.pf-card { border-top: 2px solid var(--ink); padding: 12px 0 22px; min-width: 0; }
.pf-card.pf-wide { grid-column: span 2; }
.pf-card h3 { margin: 0 0 6px; font: 800 19px/1.2 var(--sans); letter-spacing: -.01em; }
.pf-card dl { margin: 0; }
.pf-card dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rail); font-size: 15px; }
.pf-card dl > div[title] dt { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; cursor: help; }
.pf-card dt { color: var(--ink); }
.pf-card dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pf-card dd .sm { display: block; font-weight: 400; font-size: 12px; color: var(--quiet); }
.pf-card .note { margin: 10px 0 0; font-size: 13px; }
.pf-card > p { margin: 8px 0 0; font-size: 15px; }
.pf-contrib { list-style: none; margin: 0; padding: 0; }
.pf-contrib li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 96px 64px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rail); font-size: 14px; }
.pf-contrib .nm { font-weight: 800; }
.pf-contrib .bar { position: relative; height: 12px; background: linear-gradient(var(--faint), var(--faint)) no-repeat center / 1px 100%; }
.pf-contrib .bar i { position: absolute; top: 0; bottom: 0; }
.pf-contrib .bar i.up { background: var(--up); }
.pf-contrib .bar i.down { background: var(--down); }
.pf-contrib .v, .pf-contrib .x { text-align: right; font-variant-numeric: tabular-nums; }
.pf-contrib .x { color: var(--quiet); font-size: 13px; }
.pf-events { list-style: none; margin: 0; padding: 0; }
.pf-events li { padding: 8px 0; border-bottom: 1px solid var(--rail); font-size: 15px; }
.pf-events .sm { display: block; color: var(--quiet); font-size: 13px; }

@media (max-width: 1100px) { .pf-ana { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .pf-two { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .pf-start { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pf-form { padding: 20px 16px; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-bar .pick, .pf-bar .pick select { width: 100%; min-width: 0; }
  .pf-alloc li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pf-alloc .bar { display: none; }
  .pf-ana { grid-template-columns: minmax(0, 1fr); }
  .pf-card.pf-wide { grid-column: auto; }
  .pf-contrib li { grid-template-columns: 56px minmax(0, 1fr) 84px; }
  .pf-contrib .x { display: none; }
  .pf-tab { padding: 8px 11px; font-size: 14px; }
  .pf-acts { width: 100%; }
  .pf-acts .btn { flex: 1 1 auto; text-align: center; padding: 10px 12px; font-size: 15px; }
}

/* Old prices: a plain warning above the totals */
.pf-stale { margin: 0 0 18px; padding: 10px 12px; background: var(--hl); font-size: 15px; }
.pf-stale[hidden] { display: none; }

/* ---------- Nov 2026: chart modes, holding panel, map, correlation, 52-week range ---------- */
.pf-tbl tbody tr[data-open] { cursor: pointer; }
.pf-tbl tbody tr[data-open]:hover > td { background: var(--wash); }
.pf-chart path.buy { fill: var(--ink); }
.pf-legend .mk { color: var(--quiet); font-size: 13px; }
.pf-52 { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.pf-52 i { position: relative; display: inline-block; width: 70px; height: 4px; background: var(--rail); }
.pf-52 b { position: absolute; top: -4px; width: 3px; height: 12px; margin-left: -1px; background: var(--ink); }
.pf-tmap[hidden], .pf-alloc[hidden] { display: none; }
.pf-tm { position: relative; border-top: 2px solid var(--ink); }
.pf-tb { position: absolute; appearance: none; border: 0; padding: 2px; display: grid; place-content: center; text-align: center; cursor: pointer; font: 400 13px/1.15 var(--sans); color: var(--ink); overflow: hidden; }
.pf-tb.dark { color: #fff; }
.pf-tb b { font-weight: 800; font-size: 14px; }
.pf-tb:hover, .pf-tb:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.pf-corr { overflow-x: auto; }
.pf-corr table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-corr th { font-weight: 800; padding: 4px 6px; text-align: center; white-space: nowrap; }
.pf-corr tbody th { text-align: left; }
.pf-corr td { width: 44px; height: 30px; text-align: center; border: 1px solid var(--paper); }

/* Logos beside names; colour in the chart (gain green, loss red under your line) */
.pf-tbl td:first-child .lg, #pf-watch-body td:first-child .lg { float: left; margin: 2px 10px 0 0; }
.pf-chart path.area-up { fill: #DDF1E3; stroke: none; } .pf-chart path.area-dn { fill: #F9DDE1; stroke: none; }
.pf-chart path.me { stroke: var(--ink); }

/* ---------- Nov 24: On the desk beside the portfolio, the price date, totals, the Daily view ---------- */
/* The same black band as the desk pages' own sub-navigation (static/desk/desk.css .dk-nav) */
.pf-nav { background: var(--ink); color: #fff; margin: 0 0 28px; }
.pf-nav .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-height: 46px; }
.pf-nav a { color: #fff; text-decoration: none; font: 600 15px/1 var(--sans); padding: 15px 0 12px; border-bottom: 3px solid transparent; }
.pf-nav a:hover { border-bottom-color: #8C8C86; }
.pf-nav a[aria-current="page"] { border-bottom-color: var(--hl); }
.pf-nav-desk { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 18px; border-left: 1px solid #3A3A3A; }
.pf-nav-desk a b { font-weight: 800; }
.pf-nav-what { margin-left: auto; color: #A8A8A8; font-size: 13px; padding: 8px 0; }
.pf-asof { margin: 0 0 12px; font-size: 15px; }
.pf-asof[hidden] { display: none; }
.pf-asof .sm { color: var(--quiet); font-size: 13px; }
.pf-tbl tfoot th, .pf-tbl tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 800; padding-top: 10px; text-align: inherit; }
.pf-tbl tfoot td.n { text-align: right; }
.pf-tbl tfoot th .sm { font-weight: 400; }
.pf-daily[hidden], .pf-tbl[hidden] { display: none; }
.pf-dsum { margin: 0 0 12px; font-size: 16px; line-height: 1.45; max-width: 70ch; }
.pf-dbw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin: 0 0 14px; border-top: 2px solid var(--ink); }
.pf-dbw > div { padding: 10px 0; border-bottom: 1px solid var(--rail); }
.pf-dbw dt { font-size: 13px; color: var(--quiet); }
.pf-dbw dd { margin: 2px 0 0; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.pf-dbw dd .sm { display: block; font-weight: 400; font-size: 13px; color: var(--quiet); }
.pf-dchart { margin: 0 0 14px; }
.pf-dchart svg { display: block; overflow: visible; touch-action: pan-y; }
.pf-dchart text { font: 400 12px var(--sans); fill: var(--quiet); }
.pf-dchart text.cap { font-size: 11px; }
.pf-dchart .gr { stroke: var(--rail); }
.pf-dchart .zero { stroke: var(--faint); }
.pf-dchart path.me { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.pf-dchart circle.me { fill: var(--ink); }
.pf-dchart rect.up { fill: var(--up); } .pf-dchart rect.dn { fill: var(--down); }
.pf-dchart .hair { stroke: var(--quiet); stroke-width: 1; }
.pf-dtbl tr.best > td, .pf-dtbl tr.worst > td { background: var(--wash); }
.pf-dtbl .pill { margin-left: 6px; }
@media (max-width: 760px) { .pf-nav-what { display: none; } .pf-dbw { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pf-nav .wrap { gap: 0 14px; }
  .pf-nav a { font-size: 14px; padding: 13px 0 10px; }
  .pf-nav-desk { padding-left: 14px; gap: 0 14px; }
  .pf-nav-desk a:nth-child(n+3) { display: none; }   /* phones: Portfolio, On the desk, Income */
}

/* ---------- Nov 24: Charts (what you own, returns, risk, income); one group at a time ---------- */
.pf-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; align-items: start; }
.pf-fig { margin: 0; min-width: 0; border-top: 2px solid var(--ink); padding: 12px 0 26px; }
.pf-fig.pf-wide { grid-column: 1 / -1; }
.pf-fig h3 { margin: 0 0 4px; font: 800 19px/1.2 var(--sans); letter-spacing: -.01em; }
.pf-cap { margin: 0 0 10px; font-size: 15px; line-height: 1.45; max-width: 75ch; }
.pf-fig .pf-read { min-height: 2.6em; margin: 0 0 6px; color: var(--ink); font-size: 14px; line-height: 1.35; }
.pf-fsrc { margin: 10px 0 0; font-size: 13px; color: var(--quiet); line-height: 1.4; }
.pf-none { margin: 6px 0 0; }
.pf-fctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 8px; }
.pf-mini button { font-size: 13px; padding: 5px 9px; }
.pf-guide p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; max-width: 62ch; }
.pf-svg { display: block; overflow: visible; touch-action: pan-y; }
.pf-svg text { font: 400 12px var(--sans); fill: var(--quiet); font-variant-numeric: tabular-nums; }
.pf-svg text.cap { font-size: 11px; }
.pf-svg .gr { stroke: var(--rail); }
.pf-svg .zero { stroke: var(--faint); stroke-dasharray: 3 3; }
.pf-svg path.me { fill: none; stroke: #1D3557; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.pf-svg path.bm { fill: none; stroke: #7A7A75; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.pf-svg .hair { stroke: var(--quiet); stroke-width: 1; }
.pf-svg .pf-hd { fill: #1D3557; stroke: var(--paper); stroke-width: 1.5; }
.pf-svg [data-k] { outline: none; cursor: default; }
.pf-svg [data-open] { cursor: pointer; }
.pf-svg .pf-hit { fill: transparent; }
.pf-svg .on > .pf-hit { fill: var(--wash); }
.pf-svg .pf-row:focus-visible > .pf-hit, .pf-svg .pf-col:focus-visible > .pf-hit { fill: var(--wash); stroke: var(--cite); stroke-width: 2; }
.pf-svg text.pf-lab { fill: var(--ink); font-size: 13px; }
.pf-svg text.pf-lab.b, .pf-svg text.pf-num.b { font-weight: 800; fill: var(--ink); }
.pf-svg text.pf-num { fill: var(--ink); font-size: 13px; font-weight: 600; }
.pf-svg text.pf-num.q { fill: var(--quiet); font-weight: 400; }
.pf-svg text.pf-num.up { fill: var(--up); } .pf-svg text.pf-num.dn { fill: var(--down); }
.pf-svg text.pf-lg { fill: var(--ink); font-size: 12px; }
.pf-svg .pf-k-me { fill: #1D3557; } .pf-svg .pf-k-bm { fill: #7A7A75; } .pf-svg .pf-k-cost { fill: #C9CED6; }
.pf-svg rect.up { fill: var(--up); } .pf-svg rect.dn { fill: var(--down); }
.pf-svg rect.cost { fill: #C9CED6; }
.pf-svg rect.est { opacity: .45; }
.pf-svg .pf-conn { stroke: var(--quiet); stroke-dasharray: 2 2; }
.pf-svg .pf-now { stroke: var(--ink); stroke-dasharray: 4 3; }
.pf-svg .on rect:not(.pf-hit), .pf-svg .pf-row:focus-visible rect:not(.pf-hit) { stroke: var(--ink); stroke-width: 1; }
.pf-svg .pf-col.ahead rect:not(.pf-hit) { opacity: .45; }
.pf-svg .pf-col.ahead.on rect:not(.pf-hit) { opacity: .7; }
.pf-svg circle.pf-dot { fill: #1D3557; stroke: var(--paper); stroke-width: 1.5; }
.pf-svg circle.pf-dot.on, .pf-svg circle.pf-dot:focus-visible { fill: var(--hl); stroke: var(--ink); stroke-width: 2; }
.pf-svg .pf-bub { fill: rgba(29, 53, 87, .7); stroke: #1D3557; stroke-width: 1; }
.pf-svg .pf-bmk { fill: var(--paper); stroke: #7A7A75; stroke-width: 2; }
.pf-svg .pf-all { fill: var(--hl); stroke: var(--ink); stroke-width: 2; }
.pf-svg .pf-pt.on .pf-bub, .pf-svg .pf-pt:focus-visible .pf-bub { fill: var(--hl); stroke: var(--ink); stroke-width: 2; }
.pf-svg .pf-pt.on .pf-bmk, .pf-svg .pf-pt:focus-visible .pf-bmk, .pf-svg .pf-pt:focus-visible .pf-all { stroke: var(--cite); stroke-width: 3; }
.pf-svg text.pf-plab { fill: var(--ink); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.pf-svg text.pf-plab.q { fill: var(--quiet); } .pf-svg text.pf-plab.b { font-weight: 800; }
.pf-roll:focus-visible { outline: 3px solid var(--cite); outline-offset: 4px; }
.pf-sw { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 4px; font-size: 13px; }
.pf-sw i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.pf-fig .pf-legend span.me::before { background: #1D3557; }

/* Donut with its legend; the legend rows are the buttons (drill in, or open a holding) */
.pf-dwrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.pf-donut { flex: none; }
.pf-donut .pf-sl { stroke: var(--paper); stroke-width: 1.5; cursor: pointer; transition: opacity .12s; }
.pf-donut .pf-sl.on { stroke: var(--ink); stroke-width: 2.5; }
.pf-donut text.pf-dc1 { font-size: 12px; fill: var(--quiet); }
.pf-donut text.pf-dc2 { font: 800 20px var(--sans); fill: var(--ink); }
.pf-dleg { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; min-width: 0; border-top: 1px solid var(--rail); }
.pf-dleg button { appearance: none; width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 64px; gap: 8px; align-items: center; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--rail); background: none; font: 400 14px/1.25 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.pf-dleg button:hover, .pf-dleg button.on { background: var(--wash); }
.pf-dleg i { width: 12px; height: 12px; }
.pf-dleg .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-dleg .nm small { color: var(--quiet); font-size: 12px; margin-left: 2px; }
.pf-dleg .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-dleg .x { text-align: right; color: var(--quiet); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Style box: 3 x 3, size down the side, value to growth across */
.pf-sb { display: grid; grid-template-columns: 52px repeat(3, minmax(0, 96px)); gap: 3px; font-variant-numeric: tabular-nums; }
.pf-sb-h { font-size: 13px; font-weight: 600; text-align: center; align-self: end; padding: 0 0 2px; }
.pf-sb-h.r { text-align: right; align-self: center; padding: 0 6px 0 0; }
.pf-sb-c { display: grid; place-content: center; text-align: center; aspect-ratio: 1.15; min-height: 58px; border: 1px solid var(--rail); color: var(--ink); outline: none; }
.pf-sb-c.dk { color: #fff; }
.pf-sb-c b { font-size: 18px; font-weight: 800; }
.pf-sb-c small { font-size: 11px; opacity: .8; }
.pf-sb-c.on, .pf-sb-c:focus-visible { box-shadow: inset 0 0 0 3px var(--hl); border-color: var(--ink); }

/* Monthly returns: a calendar of colored cells */
.pf-mon table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-mon th { font-weight: 600; padding: 4px 0; text-align: center; color: var(--quiet); }
.pf-mon tbody th { text-align: left; color: var(--ink); font-weight: 800; width: 44px; }
.pf-mon thead th:first-child { width: 44px; }
.pf-mon td { height: 30px; text-align: center; border: 2px solid var(--paper); outline: none; }
.pf-mon td.dk { color: #fff; }
.pf-mon td.nil { background: var(--wash); }
.pf-mon td.yr { font-weight: 800; background: var(--paper); border-left: 2px solid var(--rail); }
.pf-mon td.yr.up { color: var(--up); } .pf-mon td.yr.dn { color: var(--down); } .pf-mon td.yr.q { color: var(--quiet); font-weight: 400; border-left: 0; }
.pf-mon td.on, .pf-mon td:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

@media (max-width: 860px) { .pf-figs { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pf-mon table { font-size: 11px; }
  .pf-mon td { height: 26px; border-width: 1px; }
  .pf-mon tbody th, .pf-mon thead th:first-child { width: 30px; }
  .pf-sb { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); }
  .pf-dleg button { grid-template-columns: 12px minmax(0, 1fr) auto 58px; }
  .pf-donut { margin: 0 auto; }
}

/* ---------- Nov 27: On the trades links, the loading skeleton, motion, and a tidier look beside the Desk ---------- */
.pf, .pf-trades, #pf-hold, #pf-watch { --p-ink: var(--b-text, #121212); --p-2: var(--b-text-2, #363636); --p-meta: var(--b-meta, #5F5F5F); --p-rule: var(--b-rule, #DCDCDC); --p-rule2: var(--b-rule-2, #EDEDED); --p-wash: var(--b-wash, #F5F5F3); --p-src: var(--b-src, #1F48B8); }
/* "On the trades¹" in text: the house wordmark (Public Sans 800, tight), the 1 small and raised in the brand blue */
.otr-wm { font: 800 1em/1 var(--b-sans, "Public Sans", sans-serif); letter-spacing: -.035em; white-space: nowrap; }
.otr-wm sup { font-size: .5em; font-weight: 800; color: #1F48B8; margin-left: 1px; vertical-align: .9em; line-height: 0; }
.pf-nav .pf-nav-wm .otr-wm { font-size: 16px; color: inherit; }   /* the band is light on business (bz26), dark elsewhere: follow it */
.pf-nav .pf-nav-wm .otr-wm sup { color: #1F48B8; }
/* the strip under the totals */
section.blk.pf-trades { margin-top: 0; }
section.blk .pf-tr-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; margin: 0 0 14px; }
section.blk .pf-tr-head h2 { margin: 0 !important; padding: 0 !important; border: 0 !important; font: 800 26px/1 var(--b-sans) !important; letter-spacing: -.035em !important; text-transform: none !important; }
section.blk .pf-tr-head p { margin: 0; font: 400 15px/1.4 var(--b-sans); color: var(--p-2); }
.pf-tr-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-tr-call .dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50% !important; background: var(--up, #0B6B2E); vertical-align: 1px; }
.pf-tr-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pf-tr-cards a { position: relative; display: grid; gap: 4px; height: 100%; padding: 14px 40px 14px 16px; border: 1px solid var(--p-rule); border-top: 2px solid var(--p-ink); background: #fff; color: var(--p-ink); text-decoration: none; transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out; }
.pf-tr-cards b { font: 700 18px/1.2 var(--b-serif, Georgia, serif); }
.pf-tr-cards span { font: 400 14px/1.4 var(--b-sans); color: var(--p-2); }
.pf-tr-cards i { position: absolute; right: 16px; top: 16px; font-style: normal; font-weight: 800; color: var(--p-src); transition: transform .18s ease-out; }
.pf-tr-cards a:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.pf-tr-cards a:hover i { transform: translateX(3px); }
.pf-tr-cards a:focus-visible { outline: 3px solid var(--p-src); outline-offset: 2px; }
.pf-see { margin: 12px 0 0; font: 700 14px/1.4 var(--b-sans); }
.pf-see a { color: var(--p-src); text-decoration: none; }
.pf-see a:hover { text-decoration: underline; }
.pf-see .otr-wm { color: var(--p-ink); }
.pf-see2 { display: flex; flex-wrap: wrap; gap: 0 28px; }
@media (max-width: 900px) { .pf-tr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } section.blk .pf-tr-head { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .pf-tr-cards { grid-template-columns: minmax(0, 1fr); } .pf-tr-acts .btn { flex: 1 1 auto; text-align: center; } }

/* tidier notes (no thick ink bar), headings in the site's serif, quieter table hovers */
.pf-note { background: var(--p-wash); border: 1px solid var(--p-rule2); border-left: 1px solid var(--p-rule2); }
.pf-name { font: 700 26px/1.15 var(--b-serif, Georgia, serif); letter-spacing: -.01em; }
.pf-tbl tbody tr { transition: background-color .15s ease-out; }
.pf-tbl tbody tr:hover > td { background: var(--p-wash); }
.btn, .pf-tab, .pf-start button { transition: transform .15s ease-out, background-color .15s ease-out; }
.btn:active, .pf-tab:active, .pf-start button:active { transform: scale(.98); }

/* the skeleton while prices load (no layout jump: it sits where the totals and rows go) */
.pf-skel { position: relative; overflow: hidden; margin: 6px 0 24px; }
.pf-skel[hidden] { display: none; }
.pf-skel .sk-tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 22px; }
.pf-skel .sk-tally i { display: block; height: 64px; border-top: 2px solid var(--p-rule); background: linear-gradient(var(--p-rule2), var(--p-rule2)) 0 14px / 70% 26px no-repeat; }
.pf-skel .sk-rows i { display: block; height: 14px; margin: 0 0 14px; background: var(--p-rule2); }
.pf-skel .sk-rows i:nth-child(odd) { width: 92%; } .pf-skel .sk-rows i:nth-child(even) { width: 78%; }
.pf-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: pf-shimmer 1.2s ease-in-out infinite; }
@media (max-width: 640px) { .pf-skel .sk-tally { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; } }

/* motion (static/portfolio.js, the motion layer at its end) */
@keyframes pf-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pf-rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes pf-fade { from { opacity: .25; } to { opacity: 1; } }
@keyframes pf-growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pf-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pf-flash-up { from { background-color: var(--up-bg, #E3F4E8); } to { background-color: transparent; } }
@keyframes pf-flash-down { from { background-color: var(--down-bg, #FBE5E8); } to { background-color: transparent; } }
.pf-tbl tr.pf-in { animation: pf-rise .24s ease-out both; animation-delay: calc(var(--i, 0) * 25ms); }
.pf-alloc.pf-grow .bar i { transform-origin: left center; animation: pf-growx .3s ease-out both; }
.pf-alloc.pf-grow li:nth-child(2) .bar i { animation-delay: 30ms; } .pf-alloc.pf-grow li:nth-child(3) .bar i { animation-delay: 60ms; } .pf-alloc.pf-grow li:nth-child(n+4) .bar i { animation-delay: 90ms; }
.pf-figs.pf-grow .pf-fig { animation: pf-rise .26s ease-out both; }
.pf-figs.pf-grow .pf-fig:nth-child(2) { animation-delay: 50ms; } .pf-figs.pf-grow .pf-fig:nth-child(3) { animation-delay: 100ms; } .pf-figs.pf-grow .pf-fig:nth-child(n+4) { animation-delay: 150ms; }
path.pf-draw, polyline.pf-draw { stroke-dasharray: 1; animation: pf-draw .3s ease-out both; }
.pf-xfade { animation: pf-fade .22s ease-out both; }
#pf-facts dd.pf-flash-up { animation: pf-flash-up .9s ease-out; }
#pf-facts dd.pf-flash-down { animation: pf-flash-down .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .pf-tbl tr.pf-in, .pf-alloc.pf-grow .bar i, .pf-figs.pf-grow .pf-fig, path.pf-draw, polyline.pf-draw, .pf-xfade, #pf-facts dd, .pf-skel::after, .pf-tr-cards a, .pf-tr-cards i { animation: none !important; transition: none !important; }
  .pf-tr-cards a:hover, .btn:active, .pf-tab:active { transform: none; }
}

/* bz26.css styles .pf-has .seg buttons as tabs but only .pf .seg / .pf-seg containers: give the .pf-has groups the same tab-row container */
body[data-bz] .pf-has .seg { border: 0 !important; border-bottom: 1px solid var(--b-rule) !important; gap: 22px; }

/* On the Trades (portfolio.js, only with the Worker's otr-trades meta; otherwise these stay hidden) */
#pf-body .otr-trade-link { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; font-weight: 400; color: var(--quiet) !important; text-decoration: underline !important; text-underline-offset: 2px; text-decoration-thickness: 1px; white-space: nowrap; }   /* !important: bz26.css colours every table link */
#pf-body .otr-trade-link:hover { color: var(--ink) !important; }
.pf-otf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 16px 0 0; }
.pf-otf[hidden], .pf-otw[hidden] { display: none; }
.pf-otf .btn { border-radius: 0; }
.pf-otf-msg { margin: 0; font-size: 14px; color: var(--quiet); min-width: 0; }
.pf-otf-msg a, .pf-otw a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pf-otw { margin: 12px 0 0; font-size: 15px; }
