/* Search / filter / group-by bar shared by every list (Sami 2026-11-03, new look 2026-11-09): see public/js/filterBar.js.
   One calm row: a big search box, filter pills (each opens a small searchable list), Advanced (side panel), Group by (small panel
   under its button) and the count. Chips for Advanced filters and the grouping show in a second row only when something is on. */
.fx-host { position: relative; }
.fx { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 10px; margin-bottom: 16px; box-shadow: var(--card-shadow); }
.fx-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* search: the biggest thing in the row; / jumps in */
.fx-search { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 14px; border-radius: 10px; background: var(--c-tile); border: 1px solid transparent; color: var(--c-faint); transition: border-color .15s, background .15s, box-shadow .15s; }
.fx-search:hover { background: var(--c-select); }
.fx-search:focus-within { background: var(--c-card); border-color: var(--c-accent); box-shadow: var(--focus-ring); color: var(--c-accent); }
.fx-search .ico { flex: none; width: 18px; height: 18px; }
.fx-search input { flex: 1; min-width: 0; width: auto; height: 100%; padding: 0; border: 0; box-shadow: none; outline: 0; background: none; font: inherit; font-size: var(--fs-body); color: var(--c-ink); }
.fx-search input::placeholder { color: var(--c-faint); }

/* filter pills */
.fx-quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fx-pill { position: relative; display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); background: var(--c-card); color: var(--c-text); transition: border-color .15s, background .15s, box-shadow .15s; }
.fx-pill:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.fx-pill-main { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px 0 14px; font-size: var(--fs-table); font-weight: var(--fw-medium); cursor: pointer; border-radius: var(--r-pill); white-space: nowrap; max-width: 260px; /* hover: on .fx-pill:hover */ }
.fx-pill-main b { overflow: hidden; text-overflow: ellipsis; font-weight: var(--fw-semibold); color: var(--c-accent-text); }
.fx-pill-main .ico { flex: none; width: 14px; height: 14px; color: var(--c-faint); transition: transform .18s; }
.fx-pill-main[aria-expanded="true"] .ico { transform: rotate(180deg); }
.fx-pill-main:focus-visible { box-shadow: var(--focus-ring); }
.fx-pill.on { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.fx-pill.on .fx-pill-l { color: var(--c-muted); }
.fx-pill.on .fx-pill-l::after { content: ":"; }
.fx-pill.on .fx-pill-main { padding-inline-end: 4px; }
.fx-pill.on .fx-pill-main .ico { color: var(--c-accent); }
.fx-pill-x { all: unset; display: grid; place-items: center; width: 22px; height: 22px; margin: 0 6px 0 2px; border-radius: 50%; color: var(--c-accent-text); cursor: pointer; }
.fx-pill-x svg, .fx-chip button svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.fx-pill-x:hover { background: var(--c-accent); color: var(--c-card); }
.fx-pill-x:focus-visible { box-shadow: var(--focus-ring); }
/* a yes/no quick filter is a pill too */
.fx-pill-tg { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-text); border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); background: var(--c-card); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.fx-pill-tg:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.fx-pill-tg:focus-visible { box-shadow: var(--focus-ring); }

/* the end of the row: Advanced, Group by, Clear all, the count */
.fx-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.fx-tool { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; font: inherit; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-text); background: var(--c-card); border: 1px solid var(--c-line-strong); border-radius: 10px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.fx-tool .ico { width: 16px; height: 16px; color: var(--c-muted); }
.fx-tool:hover, .fx-tool[aria-expanded="true"] { border-color: var(--btn2-hover-border); background: var(--btn2-bg); color: var(--btn2-ink); }
.fx-tool:hover .ico, .fx-tool[aria-expanded="true"] .ico { color: var(--btn2-ink); }
.fx-tool.on { border-color: var(--btn2-border); background: var(--btn2-bg); color: var(--btn2-ink); }
.fx-tool.on .ico { color: var(--btn2-ink); }
.fx-tool.on .ico-fill { fill: currentColor; fill-opacity: .22; } /* the funnel fills softly while a filter is on (Sami 2026-11-16, #326) */
.fx-tool:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fx-badge { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-card); font-size: var(--fs-hint); font-weight: var(--fw-semibold); }
.fx-count { padding: 0 4px 0 8px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-count:empty { display: none; }

/* second row: only when an Advanced filter or a grouping is on (or the list has a sort / view switch) */
.fx-status { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-line); }
.fx-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fx-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 4px 0 12px; font-size: var(--fs-hint); color: var(--c-text); background: var(--c-accent-soft); border: 1px solid var(--c-accent-line); border-radius: var(--r-pill); }
.fx-chip b { font-weight: var(--fw-semibold); color: var(--c-accent-text); }
.fx-chip > .ico { width: 14px; height: 14px; color: var(--c-accent); }
.fx-chip .fx-sep { font-style: normal; margin: 0 5px; color: var(--c-faint); }
.fx-chip button:not(.fx-chip-main) { all: unset; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--c-accent-text); cursor: pointer; }
.fx-chip button:not(.fx-chip-main):hover { background: var(--c-accent); color: var(--c-card); }
.fx-chip button:focus-visible { box-shadow: var(--focus-ring); }
.fx-chip .fx-chip-main { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border-radius: var(--r-pill); }
.fx-chip .fx-chip-main:hover { color: var(--c-accent-text); text-decoration: underline; text-underline-offset: 3px; }
.fx-chip.grp { background: var(--c-tile); border-color: var(--c-line-strong); }
.fx-chip.grp b { color: var(--c-ink); }
.fx-chip.grp > .ico { color: var(--c-ink); }
.fx-sortpill .fx-pill-l { color: var(--c-muted); }
.fx-sortpill .fx-pill-l::after { content: ":"; }
.fx-sortpill .fx-pill-main b { color: var(--c-ink); }

/* selects inside Advanced and Sort */
.fx-select { position: relative; display: flex; align-items: center; }
.fx-select select { appearance: none; -webkit-appearance: none; width: 100%; height: 40px; padding: 0 34px 0 12px; font: inherit; font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-text); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); cursor: pointer; text-overflow: ellipsis; transition: border-color .15s, background .15s; }
.fx-select > .ico { position: absolute; right: 11px; width: 15px; height: 15px; color: var(--c-faint); pointer-events: none; }
.fx-select select:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.fx-select select:focus-visible, .fx-range input:focus-visible { outline: none; border-color: var(--c-accent); box-shadow: var(--focus-ring); }
.fx-select.on select { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-select.on > .ico { color: var(--c-accent); }

/* the small list under a pill */
.fx-pop { position: absolute; z-index: 130; width: 280px; max-width: calc(100vw - 24px); padding: 6px; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: 14px; box-shadow: var(--shadow-pop); transform-origin: top left; animation: fx-pop .16s cubic-bezier(.2,.8,.2,1); }
.fx-pop[hidden] { display: none; }
@keyframes fx-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.fx-pop-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 8px; }
.fx-pop-h b { font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.fx-pop-clear { all: unset; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-accent-text); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.fx-pop-clear:hover { background: var(--c-accent-soft); }
.fx-pop-q { display: flex; align-items: center; gap: 8px; height: 38px; margin: 0 2px 6px; padding: 0 10px; border-radius: 9px; background: var(--c-tile); border: 1px solid var(--c-line); color: var(--c-faint); }
.fx-pop-q:focus-within { background: var(--c-card); border-color: var(--c-accent); box-shadow: var(--focus-ring); color: var(--c-accent); }
.fx-pop-q .ico { width: 16px; height: 16px; flex: none; }
.fx-pop-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: var(--fs-table); color: var(--c-ink); }
.fx-pop-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 1px; }
.fx-opt { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; font-size: var(--fs-table); color: var(--c-text); border-radius: 8px; cursor: pointer; }
.fx-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-opt:hover, .fx-opt:focus-visible { background: var(--c-select); color: var(--c-ink); }
.fx-opt[hidden] { display: none; }
.fx-opt.any { color: var(--c-muted); }
.fx-opt.on { background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-tick { flex: none; width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; opacity: 0; }
.fx-opt.on .fx-tick { opacity: 1; }
.fx-pop-none { margin: 0; padding: 14px 10px; font-size: var(--fs-table); color: var(--c-faint); text-align: center; }
.fx-pop-none[hidden] { display: none; }

@media (max-width: 860px) {
  .fx { padding: 8px; }
  .fx-search { flex-basis: 100%; }
  .fx-quick { flex-wrap: nowrap; overflow-x: auto; flex: 1 1 100%; min-width: 0; padding: 1px 1px 3px; scrollbar-width: none; }
  .fx-quick::-webkit-scrollbar { display: none; }
  .fx-pill, .fx-pill-tg { flex: none; }
  .fx-tools { flex: 1 1 100%; margin: 0; }
  .fx-tool { flex: 1; justify-content: center; }
  .fx-groups { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .fx-pop { animation: none; } .fx-pill-main .ico { transition: none; } }

.fx-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.fx-group { margin: 0; padding: 14px; min-width: 0; display: grid; gap: 12px; align-content: start; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-md); }
.fx-group legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .5px; text-transform: uppercase; color: var(--c-faint); }
.fx-field { display: grid; gap: 6px; min-width: 0; }
.fx-field > span { font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-text); }
.fx-field > span em { font-style: normal; color: var(--c-faint); font-weight: 400; }
.fx-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.fx-range i { font-style: normal; color: var(--c-faint); }
.fx-range input { width: 100%; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: var(--fs-table); color: var(--c-ink); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); }
.fx-range.on input { border-color: var(--c-select-line); }
.fx-date { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: var(--fs-table); color: var(--c-faint); text-align: start; background: var(--c-card); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.fx-date .ico { flex: none; width: 16px; height: 16px; color: var(--c-faint); }
.fx-date:hover { border-color: var(--c-select-line); background: var(--c-tile); }
.fx-date.on { color: var(--c-ink); font-weight: var(--fw-semibold); border-color: var(--c-select-line); }
.fx-date.on .ico, .fx-date[aria-expanded="true"] .ico { color: var(--c-ink); }
.fx-date[aria-expanded="true"] { border-color: var(--c-ink); }
.fx-date:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.fx-cal { margin-top: 8px; }
.fx-cal[hidden] { display: none; }
.fx-seg { display: flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--c-neutral-soft); }
.fx-seg button { flex: 1; min-width: 0; padding: 7px 6px; font: inherit; font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-muted); background: none; border: 0; border-radius: var(--r-md); cursor: pointer; white-space: nowrap; }
.fx-seg button:hover { color: var(--c-ink); }
.fx-seg button[aria-pressed="true"] { background: var(--c-card); color: var(--c-ink); font-weight: var(--fw-semibold); box-shadow: 0 1px 3px rgba(20,20,28,.12); }
.fx-seg button:focus-visible, .fx-toggle:focus-visible, .fx-chip button:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.fx-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; font: inherit; font-size: var(--fs-table); color: var(--c-text); background: var(--c-card); border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); cursor: pointer; transition: border-color .15s, background .15s; }
.fx-toggle .ico { width: 15px; height: 15px; color: var(--c-faint); }
.fx-toggle:hover { border-color: var(--c-select-line); background: var(--c-tile); }
.fx-toggle[aria-pressed="true"] { background: var(--c-select); border-color: var(--c-ink); color: var(--c-text); font-weight: var(--fw-semibold); }
.fx-toggle[aria-pressed="true"] .ico { color: var(--c-ink); }

/* Advanced = a side panel (not modal: the list stays visible and live). Group by = a small panel under its own button. */
.fx-dlg { position: fixed; inset-block: 0; inset-inline: auto 0; margin: 0; width: min(440px, 100vw); height: 100vh; max-height: none; padding: 0; border: 0; border-start-start-radius: 18px; border-end-start-radius: 18px; background: var(--c-card); color: var(--c-text); box-shadow: -18px 0 50px rgba(16,24,40,.16); z-index: 120; flex-direction: column; overflow: hidden; }
.fx-dlg[open] { display: flex; animation: fx-slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes fx-slide { from { transform: translateX(28px); opacity: 0; } }
.fx-dlg .fx-groups { grid-template-columns: 1fr; }
.fx-dlg .modal-body { padding-block: 4px 20px; }
.fx-dlg .modal-foot { align-items: center; }
.fx-dlg .modal-foot .link:disabled { opacity: .45; cursor: default; }
.fx-live { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); }
.fx-dlg.fx-anchor { position: absolute; inset: auto; width: 340px; max-width: calc(100vw - 24px); height: auto; max-height: min(560px, 80vh); border: 1px solid var(--c-card-line); border-radius: 14px; box-shadow: var(--shadow-pop); z-index: 130; }
.fx-dlg.fx-anchor[open] { animation: fx-pop .16s cubic-bezier(.2,.8,.2,1); }
.fx-anchor .modal-head { padding: 14px 16px 6px; border: 0; }
.fx-anchor .modal-head h2 { font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.fx-anchor .modal-body { padding: 4px 10px 10px; overflow-y: auto; }
.fx-anchor .modal-foot { padding: 10px 14px; border-top: 1px solid var(--c-line); }
@media (max-width: 640px) { .fx-dlg { width: 100vw; border-radius: 0; } .fx-dlg.fx-anchor { left: 0 !important; width: 100%; border-radius: 14px; } }
@media (prefers-reduced-motion: reduce) { .fx-dlg[open] { animation: none; } }
.fx-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 180px; overflow-y: auto; }
.fx-check { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-table); color: var(--c-text); cursor: pointer; }
.fx-check:hover { color: var(--c-ink); background: var(--c-select-line); box-shadow: 0 0 0 4px var(--c-select-line); border-radius: var(--r-sm); }

/* Group by levels: a nested path, each level a step further in */
.fx-levels { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.fx-levels li { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 2px; background: var(--c-accent-soft); border: 1px solid var(--c-accent-line); border-radius: 10px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); transition: box-shadow .15s, border-color .15s; }
.fx-levels li.lv1 { margin-inline-start: 14px; }
.fx-levels li.lv2 { margin-inline-start: 28px; }
.fx-levels li.lv3 { margin-inline-start: 42px; }
.fx-levels li.lv4 { margin-inline-start: 56px; }
.fx-levels li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-levels li.fx-none { height: auto; gap: 10px; padding: 14px 12px; color: var(--c-muted); font-weight: var(--fw-regular); background: var(--c-tile); border: 1px dashed var(--c-line-strong); }
.fx-levels li.fx-none .ico { width: 18px; height: 18px; flex: none; color: var(--c-faint); }
.fx-levels li.dragging { position: relative; z-index: 2; border-color: var(--c-accent); box-shadow: 0 10px 26px rgba(16,24,40,.18); cursor: grabbing; }
.fx-grip { all: unset; display: grid; place-items: center; width: 22px; height: 30px; color: var(--c-faint); cursor: grab; border-radius: var(--r-sm); touch-action: none; }
.fx-grip:hover { color: var(--c-ink); }
.fx-grip:focus-visible { box-shadow: var(--focus-ring); }
.fx-grip svg { width: 14px; height: 18px; fill: currentColor; }
.fx-del { all: unset; display: grid; place-items: center; width: 26px; height: 26px; color: var(--c-muted); border-radius: 50%; cursor: pointer; transition: background .15s, color .15s; }
.fx-del svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.fx-del:hover { background: var(--c-accent); color: var(--c-card); }
.fx-del:focus-visible { box-shadow: var(--focus-ring); }
body.fx-dragging, body.fx-dragging * { cursor: grabbing !important; user-select: none; }
.fx-lvl { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-card); font-size: var(--fs-hint); font-weight: var(--fw-semibold); }
.fx-lvl:empty { display: none; }
.fx-gsub { margin: 4px 6px 6px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-ink); }
.fx-gsub span { margin-inline-start: 6px; font-weight: var(--fw-regular); color: var(--c-faint); }
.fx-gfields { display: grid; gap: 1px; }
.fx-gfields .fx-opt[aria-pressed="true"] { background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-gfields .fx-opt:disabled { opacity: .45; cursor: default; }
.fx-plus { flex: none; width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; color: var(--c-faint); }
.fx-gfields .fx-opt[aria-pressed="true"] .fx-plus { display: none; }
.fx-gfields .fx-opt:hover .fx-plus { color: var(--c-accent); }

/* Grouped tables, like Odoo (Sami 2026-11-09): a solid dark caret (right = closed, down = open), the group name bold with its count
   in brackets right after it, totals at the end in plain text. Rows ~38px, each inner level steps in 20px. Outer groups on a light
   grey row, inner groups white. No tick box on group rows (the header tick box selects all). No side lines (#119). */
table.tbl tr.grp-row > td { padding: 0; border-bottom: 1px solid var(--c-line); background: var(--c-card); white-space: normal; }
table.tbl tr.grp-row[data-depth="0"] > td { background: var(--c-tile); }
table.tbl tbody tr.grp-row:hover > td { background: var(--c-select); }
/* the header stays the width of what you see, so its totals never hide off to the right of a wide table */
.tbl-wrap:has(tr.grp-row) { container-type: inline-size; }
.grp-head { position: sticky; left: 0; box-sizing: border-box; width: 100cqw; display: flex; align-items: center; min-height: 38px; padding-inline-start: 12px; }
.grp-head.d1 { padding-inline-start: 32px; }
.grp-head.d2 { padding-inline-start: 52px; }
.grp-head.d3 { padding-inline-start: 72px; }
.grp-head.d4 { padding-inline-start: 92px; }
.grp-toggle { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 8px 16px 8px 0; font: inherit; font-size: var(--fs-body); line-height: 1.3; color: var(--c-ink); background: none; border: 0; text-align: start; cursor: pointer; /* hover: on table.tbl tbody tr.grp-row:hover > td and .grp-block > summary.grp-toggle:hover */ }
.grp-toggle:focus-visible { outline: none; box-shadow: inset var(--focus-ring); border-radius: 6px; }
.grp-caret { flex: none; width: 12px; height: 12px; fill: var(--c-ink); transition: transform .15s; }
.grp-toggle[aria-expanded="true"] .grp-caret, .grp-block[open] > summary .grp-caret { transform: rotate(90deg); }
.grp-toggle b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-count { flex: none; font-weight: 700; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.grp-head:not(.d0) .grp-toggle b, .grp-head:not(.d0) .grp-count { font-weight: var(--fw-semibold); }
.grp-aggs { margin-inline-start: auto; display: flex; gap: 16px; }
.grp-agg { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .grp-head.d1 { padding-inline-start: 24px; } .grp-head.d2 { padding-inline-start: 36px; } .grp-head:is(.d3, .d4) { padding-inline-start: 48px; } }
@media (prefers-reduced-motion: reduce) { .grp-caret { transition: none; } }
/* Totals under their own columns, like Odoo (Sami 2026-11-13, groupBy.js `cells`): the name spans the columns before the first
   total and stays in view while the table scrolls sideways; each total sits under its column, in the column's own alignment.
   The whole group row opens / closes on a tap. */
table.tbl tr.grp-row { cursor: pointer; /* hover: on table.tbl tbody tr.grp-row:hover > td */ }
table.tbl tr.grp-row > td.grp-name { position: static; width: auto; min-width: 0; max-width: none; }
td.grp-name .grp-head { width: max-content; max-width: 100%; } /* narrower than its cell, so it can slide and stay in view */
table.tbl tr.grp-row > td.grp-sum { padding: 0 16px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Board view of Leads: no sort or grouping there */

/* Grouped cards and rows (groupBy.js groupedBlocks), the same Odoo rows as the tables (Sami 2026-11-13: one Group by look on every
   screen): one white sheet, a ~38px band per group with a line under it, outer groups light grey, inner ones white, each level 20px
   further in; the cards sit under the deepest group on the page grey so they still read as cards, rows sit on white. */
.grp-stack { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); overflow: hidden; }
.grp-block > summary.grp-toggle { list-style: none; min-height: 38px; box-sizing: border-box; padding: 8px 16px 8px 12px; background: var(--c-card); border-bottom: 1px solid var(--c-line); border-radius: 0; }
.grp-block > summary.grp-toggle::-webkit-details-marker { display: none; }
.grp-block.d0 > summary.grp-toggle { background: var(--c-tile); }
.grp-block > summary.grp-toggle:hover { background: var(--c-select); }
.grp-block:not(.d0) > summary b, .grp-block:not(.d0) > summary .grp-count { font-weight: var(--fw-semibold); }
.grp-block.d1 > summary.grp-toggle { padding-inline-start: 32px; }
.grp-block.d2 > summary.grp-toggle { padding-inline-start: 52px; }
.grp-block.d3 > summary.grp-toggle { padding-inline-start: 72px; }
.grp-block.d4 > summary.grp-toggle { padding-inline-start: 92px; }
.grp-stack > .grp-block:last-child:not([open]) > summary.grp-toggle { border-bottom: 0; }
.grp-leaf { padding: 16px; background: var(--c-page); border-bottom: 1px solid var(--c-line); }
.grp-leaf.d1 { padding-inline-start: 32px; }
.grp-leaf.d2 { padding-inline-start: 52px; }
.grp-leaf.d3 { padding-inline-start: 72px; }
.grp-leaf:is(.d4, .d5) { padding-inline-start: 92px; }
@media (max-width: 640px) { .grp-block.d1 > summary.grp-toggle, .grp-leaf.d1 { padding-inline-start: 24px; } .grp-block.d2 > summary.grp-toggle, .grp-leaf.d2 { padding-inline-start: 36px; } .grp-block:is(.d3, .d4) > summary.grp-toggle, .grp-leaf:is(.d3, .d4, .d5) { padding-inline-start: 48px; } }
.grp-leaf:has(> :is(ul, .pb-list)) { padding: 0; background: var(--c-card); } /* rows, not cards: straight under the band, like table rows */

/* Panel header: the title with the live result count under it; footer: Reset on one side, Done on the other (Sami 2026-11-09). */
.fx-dlg-t { display: grid; gap: 2px; }
.fx-dlg-t .fx-live { font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-muted); }
.fx-dlg-t .fx-live:empty { display: none; }
.fx-anchor .fx-dlg-t .fx-live { text-transform: none; letter-spacing: 0; }
/* Reset / Clear all / x on a chip are blue, never red: they take a filter off the screen, nothing is deleted (Sami 2026-11-09) */
.fx-reset { margin-inline-end: auto; }
.fx-reset:disabled { color: var(--c-faint); border-color: var(--c-line); background: var(--c-card); cursor: default; }
/* the small list inside a panel must not take the panel's field look (labels there stack their content) */
.fx-pop .fx-pop-q { flex-direction: row; gap: 8px; font-size: var(--fs-table); font-weight: var(--fw-regular); }
.fx-pop-list { overflow-x: hidden; }

/* Search that is on (Sami 2026-11-09: "I didn't notice I was searching"): the box turns soft blue with a blue edge and a clear x. */
.fx-search input::-webkit-search-cancel-button { display: none; }
.fx-search.on { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent); }
.fx-search.on input { font-weight: var(--fw-semibold); }
.fx-search-x { all: unset; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c-accent); color: var(--c-card); cursor: pointer; transition: background .15s, transform .15s; }
.fx-search-x svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.fx-search-x:hover { background: var(--c-btn-hover); transform: scale(1.06); }
.fx-search-x:focus-visible { box-shadow: var(--focus-ring); }

/* The count: grey when nothing is on; a blue pill when the list is filtered; a short pulse whenever the results change. */
.fx-count.on { padding: 0 12px; height: 30px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--c-accent-soft); color: var(--c-accent-text); border: 1px solid var(--c-accent-line); }
.fx-count.flash { animation: fx-flash .7s cubic-bezier(.2,.8,.2,1); }
@keyframes fx-flash { 0% { transform: scale(1); } 25% { transform: scale(1.12); background: var(--c-accent); color: var(--c-card); border-color: var(--c-accent); } 100% { transform: scale(1); } }

/* Yes / no filter = a switch: a little track and knob, so it never looks like a pick list (Sami 2026-11-09). */
.fx-pill-tg { gap: 9px; padding: 0 14px 0 10px; }
.fx-sw { position: relative; flex: none; width: 30px; height: 18px; border-radius: var(--r-pill); background: var(--c-line-strong); transition: background .18s; }
.fx-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--c-card); box-shadow: 0 1px 2px rgba(16,24,40,.25); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.fx-pill-tg[aria-pressed="true"] { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-pill-tg[aria-pressed="true"] .fx-sw { background: var(--c-accent); }
.fx-pill-tg[aria-pressed="true"] .fx-sw::after { transform: translateX(12px); }
.fx-toggles .fx-pill-tg { height: 34px; }

/* Many picks: tick boxes in the list, a "N picked" note, Done at the bottom */
.fx-box { flex: none; position: relative; width: 16px; height: 16px; border: 1.5px solid var(--c-line-strong); border-radius: 4px; background: var(--c-card); transition: background .12s, border-color .12s; }
.fx-opt.on .fx-box { background: var(--c-accent); border-color: var(--c-accent); }
.fx-opt.on .fx-box::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid var(--c-card); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fx-pop.multi .fx-opt:not(.any) .fx-tick { display: none; }
.fx-pop.multi .fx-opt.on:not(.any) { background: none; color: var(--c-ink); }
.fx-pop.multi .fx-opt.on:not(.any):hover { background: var(--c-select); }
.fx-pop-n { margin-inline-start: auto; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-accent-text); }
.fx-pop-n:empty { display: none; }
.fx-pop-f { display: flex; justify-content: flex-end; padding: 8px 4px 2px; margin-top: 6px; border-top: 1px solid var(--c-line); }

/* A many-pick field inside Advanced: looks like a pick box, opens the same small list */
.fx-msel { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: var(--fs-table); font-weight: var(--fw-medium); color: var(--c-muted); text-align: start; background: var(--c-card); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.fx-msel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-msel .ico { flex: none; width: 15px; height: 15px; color: var(--c-faint); }
.fx-msel:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.fx-msel:focus-visible { outline: none; border-color: var(--c-accent); box-shadow: var(--focus-ring); }
.fx-msel.on { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-msel.on .ico { color: var(--c-accent); }
@media (prefers-reduced-motion: reduce) { .fx-count.flash { animation: none; } .fx-sw, .fx-sw::after { transition: none; } }

/* One row (Sami 2026-11-09): compact search, then Filters / Group by / Sort, the count at the far end */
.fx-bar > .fx-search { flex: 1 1 160px; max-width: 320px; }
@media (min-width: 861px) { .fx-bar:has(> .fx-search) { flex-wrap: nowrap; } .fx-bar > .fx-tools, .fx-bar > .fx-count { flex: none; } }
.fx-bar > .fx-tools { margin-inline-start: 0; }
.fx-bar > .fx-count { margin-inline-start: auto; }

/* Filters panel: "Common" fields, then the way into Advanced */
.fx-dlg.fx-anchor { overflow: visible; }
.fx-anchor .modal-head { border-start-start-radius: 14px; border-start-end-radius: 14px; }
.fx-anchor .modal-foot { border-end-start-radius: 14px; border-end-end-radius: 14px; background: var(--c-card); }
.fx-sec { margin: 2px 6px 8px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--c-faint); }
.fx-common { display: grid; gap: 12px; padding: 0 6px 4px; }
.fx-common .fx-toggles { padding-top: 2px; }
.fx-advlink { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px; font: inherit; text-align: start; color: var(--c-ink); background: var(--c-tile); border: 1px solid var(--c-line); border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.fx-advlink > .ico { flex: none; width: 18px; height: 18px; color: var(--c-accent); }
.fx-advlink span { flex: 1; display: grid; gap: 1px; font-size: var(--fs-table); font-weight: var(--fw-semibold); }
.fx-advlink small { font-size: var(--fs-hint); font-weight: var(--fw-regular); color: var(--c-muted); }
.fx-advlink .fx-badge[hidden] { display: none; }
.fx-go { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--c-muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fx-advlink:hover { background: var(--c-accent-soft); border-color: var(--c-accent-line); }
.fx-advlink:hover .fx-go { stroke: var(--c-accent); }
.fx-advlink:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Second row: chips on one side; Expand / Collapse and Clear all on the other */
.fx-status-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.fx-chip { white-space: nowrap; }
.fx-chip.grp b { display: inline-flex; align-items: center; }
@media (max-width: 860px) {
  .fx-bar > .fx-search { flex: 1 1 100%; max-width: none; }
  .fx-bar > .fx-tools { flex: 1 1 auto; }
  .fx-status-end { margin-inline-start: 0; flex: 1 1 100%; justify-content: space-between; }
}


/* Expand / Collapse all: two small icons inside the grouping chip (Sami 2026-11-09), name on hover */
.fx-chip .fx-folds { display: inline-flex; gap: 2px; margin-inline-start: 4px; padding: 2px; border-radius: var(--r-pill); background: var(--c-card); }
.fx-chip .fx-folds .fx-fold { all: unset; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--c-text); cursor: pointer; }
.fx-chip .fx-folds .fx-fold svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fx-chip .fx-folds .fx-fold:hover { background: var(--c-accent); color: var(--c-card); }
.fx-chip .fx-folds .fx-fold:focus-visible { box-shadow: var(--focus-ring); }
.fx-chip > .ico { flex: none; }

/* Sort button panel (Sami 2026-11-11, DECISIONS #188): sections of fields, each with a small icon tile; the usual order is tagged
   Default; the picked row is tinted and opens its two directions in words (blue = the one in use). Built in filterBar.js. */
.fx-sortdlg { width: 360px; }
.fx-sortdlg .fx-sec { margin: 12px 6px 4px; }
.fx-sortdlg .fx-sec:first-child { margin-top: 2px; }
.fx-srow { border-radius: 10px; }
.fx-srow .fx-opt { width: 100%; min-height: 40px; }
.fx-srow.on { background: var(--c-accent-soft); box-shadow: inset 0 0 0 1px var(--c-accent-line); }
.fx-srow.on .fx-opt { background: none; color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.fx-srow.on .fx-tick { opacity: 1; }
.fx-stile { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--c-tile); color: var(--c-muted); }
.fx-stile .ico { width: 15px; height: 15px; }
.fx-srow.on .fx-stile { background: var(--c-card); color: var(--c-accent); }
.fx-sdef { flex: none; padding: 1px 8px; border-radius: var(--r-pill); background: var(--c-tile); color: var(--c-muted); font-size: var(--fs-hint); font-weight: var(--fw-semibold); }
.fx-sdir { display: none; margin: 0 8px 8px 44px; background: var(--c-card); box-shadow: inset 0 0 0 1px var(--c-accent-line); }
.fx-srow.on .fx-sdir { display: flex; }
.fx-sdir button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fx-sdir button svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fx-sdir button[aria-pressed="true"] { background: var(--c-accent); color: var(--c-card); box-shadow: none; }

/* Icon-only list tools (Sami 2026-11-11, DECISIONS #191; createFilterBar({ icons: true })): square buttons, the count as a small dot-badge
   on the corner, the name in the shared name tag (.ib-tip). The search keeps the row beside them on a tablet. */
.fx-icons .fx-tool { position: relative; width: 36px; padding: 0; justify-content: center; flex: none; -webkit-touch-callout: none; user-select: none; }
.fx-icons .fx-tool > span { display: none; }
.fx-icons .fx-tool .ico { width: 18px; height: 18px; }
.fx-icons .fx-tool .fx-badge { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 18px; height: 18px; padding: 0 5px; box-shadow: 0 0 0 2px var(--c-card); }
@media (max-width: 860px) {
  .fx-icons .fx-search { flex-basis: 160px; }
  .fx-icons .fx-tools { flex: none; margin-inline-start: auto; }
}

/* One-row list bar (Sami 2026-11-11, DECISIONS #193; createFilterBar({ oneRow: true })): the chips sit between the search and the
   tools and slide sideways when many, never a second row. */
.fx-onerow .fx-bar { flex-wrap: nowrap; }
.fx-onerow .fx-search { flex: 1 1 160px; }
.fx-inl { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.fx-inl::-webkit-scrollbar { display: none; }
.fx-inl:empty { display: none; }
.fx-inl .fx-chip { flex: none; height: 28px; }
.fx-onerow .fx-tools { flex: none; margin-inline-start: auto; }
@media (max-width: 640px) { .fx-onerow .fx-bar { flex-wrap: wrap; } .fx-onerow .fx-inl { order: 3; flex-basis: 100%; } }

/* Chips inside the search box, Odoo style (createFilterBar facets, Sami 2026-11-16, docs/prototypes/header-row; Units first):
   the box runs up to Filters, 36px like every control, the white box around it 6px padding (66px -> 50px). */
.fx-has-facets .fx { padding: 6px; }
.fx-bar > .fx-facets { flex: 1 1 auto; max-width: none; height: 36px; gap: 6px; padding-inline-start: 12px; border-radius: var(--r-md); cursor: text; }
.fx-facets .ico { width: 16px; height: 16px; }
.fx-facets input { min-width: 90px; font-size: var(--fs-table); }
.fx-facets > .fx-chip { flex: none; height: 26px; padding-inline-start: 8px; }
.fx-facets > .fx-chip[hidden], .fx-more[hidden] { display: none; }
.fx-facets > .fx-chip button:not(.fx-chip-main) { width: 20px; height: 20px; }
.fx-more { flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--c-accent-line); border-radius: var(--r-pill); background: var(--c-accent-soft); color: var(--c-accent-text); font: inherit; font-size: var(--fs-hint); font-weight: var(--fw-semibold); cursor: pointer; }
.fx-more:hover { background: var(--c-accent); color: var(--c-card); }
.fx-has-facets .fx-search-x { width: 24px; height: 24px; }
