/* Funds page (/funds/<T>) tables in the Attio look, 2026-10-31 — the same pass as /insiders and the stock page
   (static/css/ins-attio-table.css, fin-attio-tables.css; docs/features/funds.md "Attio table pass"). Two tables, drawn
   by js/funds.js with th[data-k] + the label in its own span (hth()):
   - Returns (#s-overview, .fd-rtbl): Returns · 1M 3M YTD 1Y 3Y 5Y 10Y
   - All holdings (#s-holdings, .fd-htbl): Holding · Weight · Value · Shares|Par · Chg since <mon> ·
     Sector|Country|Coupon · % of company|Maturity (international funds have no 7th column)
   Rules: fixed layout + width:100%, a set width on EVERY column (header-fit = 14px icon + 6 · Range-measured label ·
   24px padding + 8px slack, or the content where that is wider); Holding is content-sized with a cap (never "auto",
   so the spare width spreads over every column instead of one huge first column). Headers clip, the label ends in
   "…". Tint from cell B2: header + first column white, other body cells --at-cell; hover on the cells; values in ink.
   A box too narrow for the widths drops the header icons first (and Holding gives way), then the table scrolls
   sideways in its own box (.fd-tw); no column is ever hidden.
   The funds page is outside base.html's at-done list, so the gate is the Attio shell on desktop (html.at-shell.aiq-desk
   = not the phone layout); phones keep funds.css as it is. #fd + four :not(#_) beat base.html's forced light header
   and the shared .aiq-tbl rules. */

.fd {
  --fdic-rank: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6h14M5 12h10M5 18h6'/%3E%3C/svg%3E");
  --fdic-ret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8M15 7h6v6'/%3E%3C/svg%3E");
  --fdic-co: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V6l8-3v17M12 9h8v11M4 20h16'/%3E%3C/svg%3E");
  --fdic-pie: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9h-9Z'/%3E%3Cpath d='M15 3.5A9 9 0 0 1 20.5 9H15Z'/%3E%3C/svg%3E");
  --fdic-usd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M16.5 7.5c-.6-1.5-2.3-2.5-4.5-2.5-2.5 0-4.5 1.3-4.5 3.3s2 2.7 4.5 3.2 4.5 1.3 4.5 3.3-2 3.2-4.5 3.2c-2.3 0-4-1-4.6-2.5'/%3E%3C/svg%3E");
  --fdic-shares: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 7 20M17 4l-2 16M4 9h16M3 15h16'/%3E%3C/svg%3E");
  --fdic-trade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4 3 8l4 4M3 8h14M17 20l4-4-4-4M21 16H7'/%3E%3C/svg%3E");
  --fdic-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='7' height='7' rx='1'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1'/%3E%3Crect x='13' y='13' width='7' height='7' rx='1'/%3E%3C/svg%3E");
  --fdic-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.5 3.8 5.5 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.5-3.8-9S9.5 5.5 12 3Z'/%3E%3C/svg%3E");
  --fdic-pct: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 5 5 19'/%3E%3Ccircle cx='7' cy='7' r='2.5'/%3E%3Ccircle cx='17' cy='17' r='2.5'/%3E%3C/svg%3E");
  --fdic-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M9 3v4M15 3v4'/%3E%3C/svg%3E");
  --at-cell: #FAFAFE;
}
html[data-theme="dark"] .fd { --at-cell: rgba(255,255,255,.018); }

/* ── shared: layout, header, cells, tint, lines ─────────────────────────────────────────────────────────────────── */
html.at-shell.aiq-desk #fd .fd-tw:has(> :is(.fd-rtbl, .fd-htbl)) { container: fdtbl / inline-size; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) {
  table-layout: fixed; width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; }
/* header: white like the first column, one 1px rule under it, 1px column lines (none after the last: the card's edge) */
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > thead > tr > th {
  background: var(--a-bg, var(--fd-card)) !important; overflow: hidden; white-space: nowrap; text-overflow: clip;
  border-top: 0 !important; border-bottom: 1px solid var(--fd-line) !important; border-right: 1px solid var(--fd-line) !important; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr > td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--fd-line) !important;
  border-top: 0 !important; border-bottom: 1px solid var(--fd-line) !important; }
/* the last row sits on the card's own edge (or .fd-more's rule): no second line under it */
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr:last-child > td { border-bottom: 0 !important; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > * > tr > :last-child { border-right: 0 !important; }
/* the label in its own span clips with "…"; the icon and the (i) tip never shrink */
html.at-shell.aiq-desk #fd table:is(.fd-rtbl, .fd-htbl) .fd-th { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; vertical-align: middle; }
html.at-shell.aiq-desk #fd table:is(.fd-rtbl, .fd-htbl) .fd-hl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.at-shell.aiq-desk #fd table:is(.fd-rtbl, .fd-htbl) .fd-th .fd-i { margin-left: 4px; }
html.at-shell.aiq-desk #fd table:is(.fd-rtbl, .fd-htbl) > thead > tr > th[data-k] > .fd-th::before {
  content: ''; display: inline-block; flex: none; width: 14px; height: 14px; margin-right: 6px;
  background: var(--a-mute, #8A8F98); -webkit-mask: var(--fdic) center / 14px 14px no-repeat; mask: var(--fdic) center / 14px 14px no-repeat; }
/* values in ink (the benchmark row and Sector were grey); gains / losses and the NEW / SOLD badges keep their colours */
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr > td.mut:not(:first-child) { color: var(--a-ink, #1D2025); }
/* tint from B2: header + first column white, every other body cell --at-cell; hover on the cells */
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr > td:not(:first-child) { background: var(--at-cell) !important; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr > td:first-child { background: var(--a-bg, var(--fd-card)) !important; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table:is(.fd-rtbl, .fd-htbl) > tbody > tr:hover > td:not([colspan]) { background: var(--a-hover, var(--fd-hover)) !important; }

/* ── Returns (Overview card): Returns 120 (46 label + 19 (i) + 20 icon + 32) · seven periods 88 (YTD 26 + 52, and a
   three-digit return like "+150.2%" + 24) = 736 ─────────────────────────────────────────────────────────────────── */
html.at-shell.aiq-desk #fd .fd-rtbl th[data-k="lbl"] { --fdic: var(--fdic-rank); }
html.at-shell.aiq-desk #fd .fd-rtbl th:not([data-k="lbl"]) { --fdic: var(--fdic-ret); }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-rtbl > thead > tr > th[data-k="lbl"] { width: 120px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-rtbl > thead > tr > th:not([data-k="lbl"]) { width: 88px; }

/* ── All holdings: Holding 360 (logo · ticker · name up to 280, then "…") · Weight 96 · Value 90 · Shares 96 / Par 90 ·
   Chg since <mon> 140 ("Chg since May" 87 + 52) · Sector 180 / Country 170 / Coupon 100 · % of company 140 / Maturity
   112. Stock fund 1102, international 952, bond 996. ──────────────────────────────────────────────────────────────── */
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="n"] { --fdic: var(--fdic-co); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="w"] { --fdic: var(--fdic-pie); }
html.at-shell.aiq-desk #fd .fd-htbl th:is([data-k="v"], [data-k="par"]) { --fdic: var(--fdic-usd); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="sh"] { --fdic: var(--fdic-shares); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="chg"] { --fdic: var(--fdic-trade); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="sec"] { --fdic: var(--fdic-grid); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="cty"] { --fdic: var(--fdic-globe); }
html.at-shell.aiq-desk #fd .fd-htbl th:is([data-k="cpn"], [data-k="own"]) { --fdic: var(--fdic-pct); }
html.at-shell.aiq-desk #fd .fd-htbl th[data-k="mat"] { --fdic: var(--fdic-date); }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="n"] { width: 360px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="w"] { width: 96px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="v"] { width: 90px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="sh"] { width: 96px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="par"] { width: 90px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="chg"] { width: 140px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="sec"] { width: 180px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="cty"] { width: 170px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="cpn"] { width: 100px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="own"] { width: 140px; }
html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl > thead > tr > th[data-k="mat"] { width: 112px; }
/* the holding's name fits its column ("…") instead of funds.css's fixed 280px cap */
html.at-shell.aiq-desk #fd .fd-htbl .fd-who .tk { flex: none; }
html.at-shell.aiq-desk #fd .fd-htbl .fd-who .nm { min-width: 0; max-width: none; white-space: nowrap; }

/* ── a box too narrow for the widths: icons go first (header-bound columns 20px narrower, Value 80 for "$541.6M", Holding gives way to 300),
   narrower still the table scrolls sideways in .fd-tw. Thresholds = the sums above (change them with a width). ──── */
@container fdtbl (max-width: 735px) {
  html.at-shell.aiq-desk #fd .fd-rtbl > thead > tr > th > .fd-th::before { display: none; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-rtbl > thead > tr > th[data-k="lbl"] { width: 100px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-rtbl > thead > tr > th:not([data-k="lbl"]) { width: 80px; }
}
@container fdtbl (max-width: 1101px) {
  html.at-shell.aiq-desk #fd .fd-htbl:has(th[data-k="own"]) > thead > tr > th > .fd-th::before { display: none; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="n"] { width: 300px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="w"] { width: 76px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="v"] { width: 80px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="sh"] { width: 76px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="chg"] { width: 120px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="own"]) > thead > tr > th[data-k="own"] { width: 120px; }
}
@container fdtbl (max-width: 995px) {
  html.at-shell.aiq-desk #fd .fd-htbl:has(th[data-k="mat"]) > thead > tr > th > .fd-th::before { display: none; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="n"] { width: 300px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="w"] { width: 76px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="v"] { width: 80px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="par"] { width: 72px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="chg"] { width: 120px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="cpn"] { width: 80px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="mat"]) > thead > tr > th[data-k="mat"] { width: 106px; }
}
@container fdtbl (max-width: 951px) {
  html.at-shell.aiq-desk #fd .fd-htbl:has(th[data-k="cty"]) > thead > tr > th > .fd-th::before { display: none; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="cty"]) > thead > tr > th[data-k="n"] { width: 300px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="cty"]) > thead > tr > th[data-k="w"] { width: 76px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="cty"]) > thead > tr > th[data-k="v"] { width: 80px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="cty"]) > thead > tr > th[data-k="sh"] { width: 76px; }
  html.at-shell.aiq-desk #fd:not(#_):not(#_):not(#_):not(#_) table.fd-htbl:has(th[data-k="cty"]) > thead > tr > th[data-k="chg"] { width: 120px; }
}
