/* FEATURES' additions to trades.css (ontrades/build.py, pages.py, svg.py). Tokens only; classes from STYLE.md first. */

/* Who cell: name, then party + chamber/state kept on one line */
.who { display: inline; }
.who .wm { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; white-space: nowrap; color: var(--quiet); font-size: 12.5px; font-weight: 400; }
.who .wm .pty { margin: 0 3px 0 0; }
.tt td .who a { font-weight: 600; }

/* Trade table: chips under the asset name, delay under the filed date, folded rows */
.cx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cx .chip { font-size: 10.5px; padding: 3px 5px 2px; }
.tt .an.an-only { max-width: 34ch; color: var(--ink-2); margin-top: 0; }

/* Home */
.ft-tape { margin: -28px calc(50% - 50vw) 24px; }
@media (max-width: 640px) { .ft-tape { margin-top: -20px; } }
.ft-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; display: inline-block; vertical-align: bottom; }
.lst .r b { font-weight: 800; }

/* Model portfolio cards */
.ft-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin: 0 0 8px; }
.ft-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink); text-decoration: none; }
.ft-card + .ft-card { padding-left: 16px; border-left: 1px solid var(--rule-2); }
.ft-card:hover { background: var(--strip); text-decoration: none; }
.ft-card-h { font: 700 15px/1.25 var(--serif); }
.ft-card-v { font: 700 24px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.ft-card-v .q { font: 400 12.5px var(--sans); }
.ft-card .q { font-size: 12.5px; }
.spark { display: block; width: 100%; height: 30px; }
.ft-sp { width: 120px; }
.ft-sp .spark { width: 110px; }
@media (max-width: 640px) { .ft-card + .ft-card { padding-left: 0; border-left: 0; } .ft-sp { display: none; } }

/* Charts drawn by ontrades/svg.py: axis labels laid over the plot */
.ft-plot { margin-left: 46px; width: calc(100% - 46px); margin-bottom: 22px; overflow: visible; }
.ft-plot .ax { position: absolute; inset: 0; pointer-events: none; font: 400 11.5px/1 var(--sans); color: var(--quiet); font-variant-numeric: tabular-nums; }
.ft-plot .ay { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); white-space: nowrap; }
.ft-plot .axx { position: absolute; top: calc(100% + 7px); transform: translateX(-50%); white-space: nowrap; display: block; margin: 0; }
.ft-plot .ft-rule { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--faint); pointer-events: none; }
.ft-plot .chart-tip { line-height: 1.45; }
.chart .src .up, .chart .src .dn { font-weight: 400; }

/* Profile head without an avatar (portfolio pages) */
.ph.ph-n { grid-template-columns: minmax(0, 1fr) auto; }
.ph .kicker { margin-bottom: 4px; }
@media (max-width: 640px) { .ph.ph-n { grid-template-columns: 1fr; } }

/* Member page three-up */
.ft-m3 .lst li { font-size: 13.5px; }

/* Hypothetical note: the callout look inside page flow */
.callout.hypo { margin: 12px 0 8px; font-size: 13.5px; line-height: 1.5; max-width: 60em; }

/* Search results */
.ft-res { max-width: 760px; }
.ft-res li a { font-weight: 600; }
.ft-res .tk { font-weight: 800; }

/* Traded · filed cell (one column for both dates) */
.tt .td1 { display: block; }
.tt td.d a.dl { display: block; font-size: 11.5px; color: var(--quiet); margin-top: 3px; text-decoration: none; }
.tt td.d a.dl:hover { color: var(--cite); text-decoration: underline; }
.tt td.d a.dl.late { color: var(--gold-on-tint); font-weight: 700; }
.tt td .nx { display: block; font-size: 11.5px; margin-top: 3px; }
.tt th.tf .srt { display: inline-flex; }
.tt th.tf .srt:not(.on)::after { display: none; }
/* who: name on one line, party and seat under it */
.who .wm { display: flex; margin: 2px 0 0; }
.tt.trades td:first-child { min-width: 0; }
@media (max-width: 640px) { .who .wm { display: inline-flex; margin-left: 6px; } .tt td.d a.dl { display: inline; margin-left: 6px; } .tt .td1 { display: inline; } }
.lst .who .wm { display: inline-flex; margin: 0 0 0 6px; }
.ft-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ft-card:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
@media (max-width: 760px) { .ft-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ft-card:nth-child(3n + 1) { padding-left: 16px; border-left: 1px solid var(--rule-2); } .ft-card:nth-child(2n + 1) { padding-left: 0; border-left: 0; } }

/* "Trade this" (Task 9): a compact button in trade-table rows, a prominent one beside Follow, and the dialog
   both open (static/tradethis.js). Never green/red (not a buy/sell signal) — plain ink/plum, like .follow. */
.tradethis { display: block; width: max-content; margin-top: 6px; background: transparent; color: var(--quiet);
  font: 600 11px/1 var(--sans); border: 1px solid var(--rail); border-radius: 4px; padding: 3px 7px; cursor: pointer; }
.tradethis:hover { background: var(--plum-tint); color: var(--plum); border-color: var(--plum-line); }
.tt td .tradethis { margin-top: 5px; }
.ph .tradethis { display: inline-flex; align-items: center; width: auto; margin-top: 0; font-size: 13px; padding: 9px 14px;
  color: var(--ink); border-color: var(--ink); }
.ph .tradethis:hover { background: var(--plum-tint); color: var(--plum); border-color: var(--plum); }
:root[data-theme="dark"] .tradethis { border-color: var(--ink-2); }

.ft-td { border: none; border-radius: 6px; padding: 0; max-width: 460px; width: calc(100% - 32px); max-height: calc(100% - 32px);
  overflow: auto; background: var(--paper); color: var(--ink); box-shadow: var(--lift); }
.ft-td::backdrop { background: color-mix(in srgb, var(--plum) 55%, transparent); }
.ft-td-form { position: relative; padding: 24px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.ft-td-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; border: 1px solid var(--rail); border-radius: 50%; color: var(--quiet);
  font-size: 18px; line-height: 1; cursor: pointer; }
.ft-td-x:hover { background: var(--plum-tint); color: var(--plum); border-color: var(--plum-line); }
.ft-td h2 { margin: 0; padding-right: 30px; font: 700 15px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .02em; }
.ft-td-restate { margin: 0; font: 400 16px/1.45 var(--serif); }
.ft-td-brokers { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-td-brokers .btn-q { padding: 8px 12px; font-size: 13px; }
.ft-td-disc.disc { margin: 4px 0 0; padding-top: 12px; }
.ft-td-ref { margin: 0; font-size: 11.5px; color: var(--quiet); }
@media (max-width: 420px) { .ft-td { width: calc(100% - 20px); } .ft-td-form { padding: 20px 16px 16px; } }

/* Task 24 (page teardown gaps) */
/* Company logo thumbnail before a ticker (feed rows, tape, home lists); the ticker text always follows it. Logos are
   drawn for white, so the tile is white in both themes. */
.lg { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; border-radius: 3px; overflow: hidden;
  background: #fff; border: 1px solid var(--rail); flex: none; }
.lg img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.tape-i .lg { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; border-color: transparent; }
/* Stock header: the logo laid over the ticker tile (the ticker shows if it fails to load) */
.av.tkav.tklg { background: #fff; }
.av.tkav img { object-fit: contain; padding: 7px; background: #fff; object-position: 50% 50%; }
.ft-px { margin: 6px 0 0; font: 400 14px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.ft-px b { font-weight: 800; font-size: 16px; }
.ft-px .q { font-size: 12.5px; }
/* Stock page signal sentence and member bio: serif reading lines */
.ft-signal, .ft-bio { font: 400 16px/1.5 var(--serif); max-width: 46em; margin: 14px 0 6px; color: var(--ink-2); }
.ft-bio .q { font: 400 12.5px var(--sans); }
/* Buys and sales by year */
.ft-bars .axx { top: calc(100% + 7px); }
.ft-bars rect { opacity: .9; }
/* Insiders: title column */
.tt td.ttl { font-size: 13px; color: var(--ink-2); max-width: 22ch; }
.ft-held { margin: 6px 0 0; }
/* the Committee filter's long names must not push the filter row past a phone's width */
.flt select { max-width: 100%; }
.flt select[name="cm"] { max-width: 20em; text-overflow: ellipsis; }
/* 390px: a ranked list row (who + trade + stock + amount) wraps instead of widening the page; and the small avatar
   stays small on phones (trades.css's phone rule for .av, 48px, otherwise wins over .av-sm by source order) */
@media (max-width: 640px) {
  .lst li { flex-wrap: wrap; }
  .av.av-sm { width: 22px; height: 22px; font-size: 10px; }
}
