/* ============================================================
   /css/system/components/column-filter.css: the column filter
   (snag round 9, item 12). The header's ▾, its orange dot when a filter is
   on, the popover, and the one "filtered: …" line above the table. No pills.
   Tokens only, from colors_and_type.css.
   ============================================================ */

.cf-head { display: inline-flex; align-items: center; gap: 4px; position: relative; white-space: nowrap; }
.cf-head__label { min-width: 0; }
.cf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.cf-head__btn {
  border: 0; background: transparent; color: inherit; font: inherit; line-height: 1; cursor: pointer;
  padding: 2px 4px; border-radius: var(--r-1); opacity: 0.7;
}
.cf-head__btn:hover, .cf-head__btn[aria-expanded="true"] { opacity: 1; background: var(--bg-muted); }
.cf-head__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }

.cf-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; max-width: 320px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--r-soft);
  box-shadow: var(--shadow-2); text-transform: none; letter-spacing: 0; font-family: var(--font-std); font-weight: 400;
  font-size: var(--t-small); white-space: normal; text-align: left;
}
th:last-child .cf-pop, .is-num .cf-pop { left: auto; right: 0; }
.cf-pop__body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.cf-pop__sort, .cf-pop__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-pop__opt {
  border: 1px solid var(--rule-2); background: var(--paper); color: inherit; font: inherit; cursor: pointer;
  padding: 5px 9px; border-radius: var(--r-1);
}
.cf-pop__opt.is-on { border-color: var(--accent); color: var(--accent); }
.cf-pop__opt:focus-visible, .cf-pop__link:focus-visible, .cf-pop__done:focus-visible, .cf-line__clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cf-pop__search, .cf-pop__between input, .cf-pop__amt input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--rule-2); border-radius: var(--r-1); padding: 6px 8px;
  font: inherit; color: inherit; background: var(--paper);
}
.cf-pop__list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.cf-pop__tick { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px; padding: 3px 2px; cursor: pointer; }
.cf-pop__tick--all { grid-template-columns: 18px 1fr; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.cf-pop__val { min-width: 0; overflow-wrap: anywhere; }
.cf-pop__n { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cf-pop__none { color: var(--fg-3); padding: 4px 2px; }
.cf-pop__between { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; }
.cf-pop__between legend { padding: 0 0 4px; color: var(--fg-2); }
.cf-pop__amt { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 6px; }
.cf-pop__foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--rule); }
.cf-pop__link, .cf-pop__done, .cf-line__clear { border: 0; background: transparent; color: var(--link); font: inherit; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.cf-pop__done { font-weight: 700; text-decoration: none; }

.cf-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 6px 0 10px; font-size: var(--t-small); color: var(--fg-2); }
.cf-line__what { color: var(--ink); }
.cf-line__count { margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  .cf-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-width: none; }
  /* a finger's target: the ▾ is 44px square at phone widths */
  .cf-head__btn { min-width: 44px; min-height: 44px; }
}
