/* Insiders (/insiders) table in the Attio look (html.at-done), 2026-10-30 — the same pass as /government
   (docs/features/gov-money.md "Attio table polish"), from the user's Attio Companies screenshot:
   - widths follow the content: fixed layout, a set width per column (th[data-k] from renderTable), Largest buyer the one
     flexible text column; the auto layout made the table 1423px in a 1205px panel (sideways scroll at a 1480px window)
   - "+ Add column" is a 44px "+"
   - the first column and the header stay white, every other body cell gets Attio's faint #FAFAFE (replaces the
     sorted-column tint); hover / selected sit on the cells so the tint doesn't hide them
   - a thin grey type icon before each header label (HIC in the template)
   Selectors carry #ins-table + two :not(#_) to beat aiq-table-attio.css's shared .aiq-tbl rules (two ids + !important). */
html.at-done #ins-table:not(#_):not(#_) { table-layout: fixed; width: 100%; min-width: 0; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k] { width: 130px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="t"] { width: 230px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="n"] { width: 200px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="sig"] { width: 120px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="who"] { width: auto; min-width: 200px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="tv"] { width: 164px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="pmc"] { width: 164px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="vc"] { width: 176px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="d"] { width: 140px; }
/* the optional columns: each header's measured width (icon · label · ⌄ · 24px padding) + 8px */
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="mc"] { width: 156px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="rp"] { width: 184px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="ni"] { width: 132px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="np"] { width: 150px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="lb"] { width: 196px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="p"] { width: 120px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="ac"] { width: 186px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="bh"] { width: 190px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="s"] { width: 170px; }
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="tier"] { width: 174px; }
/* % of mkt cap steps out below a 1260px panel (the house look: 1180px), or Largest buyer's header no longer fits */
@container (max-width: 1260px) { html.at-done #ins-table:not(.is-custom) .c-pmc { display: none; } }
/* the record cell's name and the buyer fit their column instead of a fixed max-width */
html.at-done #ins-table:not(#_):not(#_) .ins-rec { overflow: hidden; }
html.at-done #ins-table .ins-rec .ins-rec-n:not(#_):not(#_):not(#_):not(#_) { max-width: none; }
html.at-done #ins-table:not(#_):not(#_) .ins-who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html.at-done #ins-table:not(#_):not(#_) > tbody > tr > td { overflow: hidden; text-overflow: ellipsis; }

/* "+ Add column" = just the + */
html.at-done #ins-table:not(#_):not(#_) th.aiq-addcol-th, html.at-done #ins-table:not(#_):not(#_) .aiq-addcol-td { width: 44px; min-width: 44px; }
html.at-done #ins-table th.aiq-addcol-th .aiq-addcol-btn span { display: none; }
html.at-done #ins-table th.aiq-addcol-th .aiq-addcol-btn { padding: 4px 6px; }

/* tint from B2 */
html.at-done #ins-table:not(#_):not(#_) > tbody > tr.r > td:not(:first-child) { background: var(--at-cell, #FAFAFE) !important; }
html.at-done #ins-table:not(#_):not(#_) > tbody > tr.r:hover > td { background: var(--a-hover) !important; }
html.at-done #ins-table:not(#_):not(#_) > tbody > tr.r.is-open > td { background: var(--a-hover) !important; }
html.at-done[data-theme="dark"] #ins-table { --at-cell: rgba(255,255,255,.018); }

/* header icons */

html.at-done #ins-table .ins-hic { flex: none; color: var(--a-mute); }

/* narrow panel (~1000px windows): fixed layout ignores a header's min-width, so the record column gives way, or Largest
   buyer shrank to 33px. The number columns keep their widths: at 118/120px their headers (icon · label · sort arrow · ⌄)
   no longer fit and "Total bought ▾" ran into "vs insider cost" (user, 2026-10-30) */
@container (max-width: 1020px) {
  html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="t"] { width: 160px; }
}

/* headers never spill into the next column: the cell clips and the label ends in "…" (Attio's "Twitter followe…") */
html.at-done #ins-table:not(#_):not(#_) > thead > tr > th { overflow: hidden; }
html.at-done #ins-table thead .ins-sortb { min-width: 0; max-width: 100%; box-sizing: border-box; }
html.at-done #ins-table thead .ins-hl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.at-done #ins-table thead :is(.ins-hic, .ar, .ins-hcar) { flex: none; }

/* the My companies draft's tick-box column (ins-home.js + ins-home.css: th/td.ih-fcb, 36px, inserted first): no
   ellipsis (the cell rule above drew "☐…" beside its box), never tinted, and the Company column after it stays white */
html.at-done #ins-table:not(#_):not(#_) > :is(thead, tbody) > tr > .ih-fcb:not(#_) { overflow: visible; text-overflow: clip; }
html.at-done #ins-table:not(#_):not(#_) > tbody > tr.r > td:is(.ih-fcb, .ih-fcb + td):not(#_) { background: var(--a-bg) !important; }
html.at-done #ins-table:not(#_):not(#_) > tbody > tr.r:is(:hover, .is-open) > td:not(#_) { background: var(--a-hover) !important; }
/* columns picked under View settings (.is-custom): the buyer gets a set width too, so with many columns the table grows
   and scrolls sideways (as before) instead of squeezing the one flexible column to nothing */
html.at-done #ins-table.is-custom:not(#_):not(#_) > thead > tr > th[data-k="who"] { width: 240px; }
/* the narrowest step (≤820px panel, ~1000px windows), where Signal already steps out: Last buy goes too and the header
   icons hide, or Largest buyer was 5px wide next to the fixed number columns */
@container (max-width: 820px) {
  html.at-done #ins-table:not(.is-custom) .c-d { display: none; }
  html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="tv"] { width: 144px; }
  html.at-done #ins-table:not(#_):not(#_) > thead > tr > th[data-k="vc"] { width: 156px; }
}
