/* /traders/cohorts/ Wallet cohorts (named Smart money cohorts until 2026-10-07) (Kai 2026-10-06). Tokens from swan.css; long = mint, short = slate
   (long / short is not profit, so gain / loss colors stay on PnL numbers only). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ch-head h1 { letter-spacing: var(--ls-title); }
.ch-head .desc em { font-style: normal; color: var(--text); }
.ch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--sec-gap) 0 var(--space-3); }
.ch-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.ch-seg button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); font: inherit; font-size: var(--fs-md); font-weight: 600; min-height: 32px; min-width: 56px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-ctl); background: transparent; color: var(--text-mid); cursor: pointer; font-variant-numeric: tabular-nums; }
.ch-seg button:hover { color: var(--text); }
.ch-seg button[aria-selected="true"] { background: var(--surface-2); color: var(--mint); box-shadow: inset 0 0 0 1px var(--border-strong); }
/* Cohort cards (Kai 2026-10-08 green-restore, columns fixed the same day): at most 3 per row from 1280px, 2 to 3 from 900px
   (each card at least 320px wide), 1 below 900. A wrapping flex row whose cards grow: the cards left over on the last row
   share its width, so no count leaves an empty cell. Five per row was too narrow (title and value overlapped). */
.ch-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ch-grid > * { flex: 1 1 100%; min-width: 0; }
@media (min-width: 900px) { .ch-grid > .ch-card { flex-basis: calc(33.333% - var(--space-3) * 2 / 3); min-width: 320px; } }
.ch-card { position: relative; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--card-pad); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); min-width: 0; }
.ch-card:hover { border-color: var(--border-strong); }
.ch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.ch-name { margin: 0; font-size: var(--fs-base); font-weight: 600; letter-spacing: var(--ls-title); }
.ch-tag { display: inline-block; margin-right: var(--space-1); padding: 1px var(--space-1); border-radius: 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--ls-tag); color: var(--mint); background: rgba(var(--accent-rgb), .08); vertical-align: 2px; }
.ch-why { margin: 3px 0 0; font-size: var(--fs-xs); color: var(--text-mid); line-height: var(--lh-ui); }
.ch-n { flex: none; font-size: var(--fs-xs); color: var(--text-mid); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-n b { color: var(--text); font-weight: 600; }
.ch-ls { display: grid; gap: var(--space-1); }
.ch-ls-row { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); color: var(--text-mid); font-variant-numeric: tabular-nums; }
.ch-ls-row b { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.ch-ls-row .l b { color: var(--ch-long); }
.ch-ls-row .s { text-align: right; }
.ch-ls-row .s b { color: var(--ch-short); }
.ch-ls-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.ch-ls-bar i { display: block; height: 100%; }
.ch-ls-bar .l { background: var(--ch-long); }
.ch-ls-bar .s { background: var(--ch-short); }
.ch-ls-sub { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ch-facts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); margin: 0; padding-top: var(--space-2); border-top: 1px solid var(--border); font-size: var(--fs-xs); }
.ch-facts dt { color: var(--text-mid); }
.ch-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }
.ch-facts dd small { font-weight: 400; color: var(--text-dim); font-size: var(--fs-xs); margin-left: var(--space-1); }
.ch-up { color: var(--text); } .ch-dn { color: var(--text); }
.ch-gain { color: var(--gain); } .ch-loss { color: var(--loss); }
.ch-na { color: var(--text-dim); cursor: help; border-bottom: 1px dotted var(--text-dim); font-weight: 400; }
.est { display: inline-block; margin-left: var(--space-1); padding: 0 var(--space-1); border: 1px solid var(--border-strong); border-radius: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--amber); vertical-align: 2px; letter-spacing: var(--ls-tag); }
.ch-rel { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2); border-radius: var(--radius-card); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-mid); }
.ch-rel b { font-size: var(--fs-md); color: var(--text); font-variant-numeric: tabular-nums; }
.ch-rel .meter { flex: 1; height: 4px; border-radius: 2px; background: var(--border); position: relative; overflow: hidden; min-width: 40px; }
.ch-base { margin: var(--space-1) 0 0; font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ch-base span { color: var(--text-dim); }
.ch-tbl tr.ch-base-row td { color: var(--text-dim); }
.ch-tbl .ch-ns { color: var(--text-dim); }
.ch-tbl th.w { white-space: normal; min-width: 96px; max-width: 120px; }
.ch-rel .meter i { position: absolute; inset: 0 auto 0 0; background: var(--mint); }
.ch-rel .meter::after { content: ""; position: absolute; left: var(--base, 50%); top: -2px; bottom: -2px; width: 1px; background: var(--text-dim); }
/* share button: fixed at the card's bottom right, present (disabled) when the card has nothing to share */
.ch-foot-row { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: auto; padding-top: 2px; }
.ch-rel-wait .state-line { margin: 0; }
.ch-waits { padding: var(--space-1) var(--space-3); border-top: 1px solid var(--border); }
/* section head: title left, share button right, never wrapping into the title */
.ch-sec-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; margin: 0 0 var(--space-1); }
.ch-sec-title h2 { margin: 0; min-width: 0; }
.ch-sec-act { flex: none; margin-left: auto; }
.ch-sec { margin-top: var(--sec-gap); }
.ch-sec-head h2 { margin: 0 0 var(--space-1); font-size: var(--fs-lg); font-weight: 600; letter-spacing: var(--ls-title); }
.ch-sec-head p { margin: 0 0 var(--space-3); font-size: var(--fs-md); color: var(--text-mid); line-height: var(--lh-prose); max-width: 760px; }
.ch-sec-head p a, .ch-foot a { color: var(--mint); text-decoration: none; }
.ch-tbl-wrap { padding: 0; overflow-x: auto; }
.ch-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ch-tbl th, .ch-tbl td { padding: var(--space-1) var(--space-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ch-tbl th { font-size: var(--fs-xs); font-weight: 600; color: var(--text-mid); text-align: right; background: var(--surface-2); }
.ch-tbl td { text-align: right; }
.ch-tbl th:first-child, .ch-tbl td:first-child { text-align: left; }
.ch-tbl tr:last-child td { border-bottom: 0; }
.ch-tbl td small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-dim); }
.ch-tbl th.l, .ch-tbl td.l { text-align: left; }
.ch-liq { padding: var(--card-pad); }
.ch-liq > .state-line { margin: 0; }
.ch-tbl-wrap > div > .state-line { margin: var(--space-3); }
.ch-liq-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2); font-size: var(--fs-xs); color: var(--text-mid); }
.ch-liq-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.ch-liq svg { display: block; width: 100%; height: auto; }
.ch-liq .key { display: inline-flex; align-items: center; gap: var(--space-1); margin-right: var(--space-3); }
.ch-liq .key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ch-defs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2); }
.ch-def { padding: var(--card-pad); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.ch-def h3 { margin: 0 0 var(--space-1); font-size: var(--fs-md); }
.ch-def p { margin: 0; font-size: var(--fs-xs); line-height: var(--lh-prose); color: var(--text-mid); }
.ch-def p + p { margin-top: var(--space-1); }
.ch-foot { margin: var(--sec-gap) 0 0; font-size: var(--fs-xs); color: var(--text-dim); }
@media (max-width: 520px) {
  .ch-seg { width: 100%; } .ch-seg button { flex: 1; min-width: 0; }
}
.ch-wait { opacity: .35; transition: opacity .15s; pointer-events: none; }
/* five across at 1280–1440 leaves ~220px per card (Kai 2026-10-08 green-restore): fact values wrap at their spaces instead of
   running under the next card, the hit-rate meter drops to its own line. Last in the file so it wins over the base rules. */
@media (min-width: 1280px) {
  .ch-facts dt { white-space: nowrap; }
  .ch-facts dd { white-space: normal; }
  .ch-ls-row b { font-size: var(--fs-md); }
  .ch-rel { flex-wrap: wrap; }
  .ch-rel .meter { flex: 1 1 100%; order: 9; }
}

/* Kai 2026-10-08 E: validation and method fold, and the rule folded into each card */
.ch-more { margin-top: var(--sec-gap); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.ch-more-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-3); padding: var(--card-pad); cursor: pointer; list-style: none; }
.ch-more-sum::-webkit-details-marker { display: none; }
.ch-more-sum::after { content: "›"; margin-left: auto; color: var(--accent); transition: transform .15s; }
.ch-more[open] > .ch-more-sum::after { transform: rotate(90deg); }
.ch-more-t { font-size: var(--fs-lg); font-weight: 600; letter-spacing: var(--ls-title); color: var(--text); }
.ch-more-d { font-size: var(--fs-xs); color: var(--text-dim); }
.ch-more > .ch-sec { margin: 0; padding: 0 var(--card-pad) var(--card-pad); }
.ch-more > .ch-sec + .ch-sec { padding-top: var(--sec-gap); border-top: 1px solid var(--border); }
.ch-rule { margin-top: var(--space-1); font-size: var(--fs-xs); }
.ch-rule > summary { display: inline-block; cursor: pointer; color: var(--accent); list-style: none; }
.ch-rule > summary::-webkit-details-marker { display: none; }
.ch-rule > summary::after { content: " ›"; }
.ch-rule[open] > summary::after { content: " ‹"; }
.ch-rule > p { margin: var(--space-1) 0 0; color: var(--text-mid); line-height: var(--lh-prose); }
@media (prefers-reduced-motion: reduce) { .ch-more-sum::after { transition: none; } }

/* all cohorts x assets (2026-11-04) */
.ch-mx { margin: 0 0 var(--space-4); }
.ch-mx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); }
.ch-mx-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.ch-mx-head span { font-size: var(--fs-xs); color: var(--text-dim); }
.ch-mx-tbl th[scope="row"] { font-weight: 400; white-space: nowrap; }
.ch-mx-tbl th[scope="row"] .ch-tag { margin-right: var(--space-2); }
.ch-mx-tbl :is(th, td).on { background: rgba(var(--accent-rgb), .06); }
.ch-mx-tbl thead th.on { color: var(--accent); }
.ch-mx-go { display: inline-grid; grid-template-columns: auto; justify-items: end; gap: 0; width: 100%; min-height: var(--control-height); padding: var(--space-1) 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: right; }
.ch-mx-go:hover .ch-mx-v, .ch-mx-go:focus-visible .ch-mx-v { color: var(--accent); }
.ch-mx-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ch-mx-v { font-variant-numeric: tabular-nums; }
.ch-mx-bar { display: block; width: 100%; max-width: 120px; height: var(--space-1); background: rgba(var(--loss-rgb), .7); border-radius: var(--radius-ctl); overflow: hidden; }
.ch-mx-bar i { display: block; height: 100%; background: var(--gain); }
.ch-mx-g { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ch-mx-tbl th { text-align: left; }
.ch-mx-tbl th.num { text-align: right; }
.ch-mx-n { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-mx .vn-scroll { overflow-x: auto; max-width: 100%; }
@media (max-width: 767px) {
  .ch-mx-tbl :is(th, td) { padding-inline: var(--space-1); }
  .ch-mx-tbl th[scope="row"] .ch-tag { margin-right: 0; }
}
.ch-facts dd small.ch-gain { color: var(--gain); } .ch-facts dd small.ch-loss { color: var(--loss); }
