/* Table sort/filter toolbar, chips, and CSV export.

   One file, one feature, same arrangement as ticker-filter.css. The
   toolbar sits OUTSIDE the table, so style.css's `table.leaderboard a`
   (0-1-2) does not trap these links. Do not copy this file's simplicity
   into anything that lives in a row.

   Discrete filters are a GET form so every combination is a URL.
   Active filters are chips; the × is decoration, the whole chip is
   the link. */

.table-controls {
  margin: 0 0 1.1rem;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .55rem .7rem;
}

.table-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.table-toolbar-label {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-toolbar select,
.table-toolbar input[type="text"] {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--fg);
  background: var(--bg-elevated, #141412);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .28rem .5rem;
  min-width: 8rem;
}

.table-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  padding-bottom: .15rem;
}

.table-toolbar-apply,
.table-toolbar-export {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .32rem .65rem;
  border-radius: 2px;
  text-decoration: none;
}

.table-toolbar-apply {
  background: var(--fg);
  color: var(--bg, #0a0a09);
  border: 1px solid var(--fg);
  cursor: pointer;
}

.table-toolbar-export {
  color: var(--muted);
  border: 1px solid var(--border);
}

a.table-toolbar-export:hover,
a.table-toolbar-export:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
}

.table-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .65rem;
}

.table-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  padding: .22rem .5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(212, 185, 90, 0.08);
  border-color: rgba(212, 185, 90, 0.35);
  color: #D4B95A;
}

a.table-chip:hover,
a.table-chip:focus-visible {
  border-color: #D4B95A;
  color: var(--fg);
}

.table-chip-clear {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

a.table-chip-clear:hover,
a.table-chip-clear:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
}

/* Congress header sort links: the page-level rule colours every
   `.congress-table a` gold with an underline, which is right for
   tickers and wrong for a column heading. */
.congress-table th a {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  letter-spacing: 0.08em;
}

.congress-table th a:hover,
.congress-table th.sorted a {
  color: #F2F0EA;
  border-bottom: none;
}

.congress-table th.sorted {
  color: #F2F0EA;
}
