/* =========================================================
   Card-style lists (Expenses first; every list gets this look in turn).
   Components: list card shell, row grid, tiles, tags, totals widget, filter bar + chips + panel,
   segmented control, sort control, bulk bar, date-range popover, grouped (expandable) rows.
   Built ONLY from the --fm-* tokens of theme.css, so light and dark both work (theme.css loads after
   this file but only defines the tokens). Behaviour lives in public/js/list-ui.js.
   ========================================================= */

:root, [data-bs-theme] {
  --fm-hover: color-mix(in srgb, var(--fm-brand-soft) 45%, var(--fm-surface));
  --fm-shadow: 0 1px 2px rgba(18, 28, 38, .05), 0 6px 20px rgba(18, 28, 38, .05);
}
[data-bs-theme="dark"] { --fm-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); }

.fm-num { font-variant-numeric: tabular-nums; }
.fm-ico { width: 1em; height: 1em; flex: none; }

/* ---------- header ---------- */
.fm-list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fm-list-head h3 { margin: 0; }
.fm-list-head .fm-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.fm-select-btn[aria-pressed="true"] { background: var(--fm-brand-soft); border-color: var(--fm-brand-text); color: var(--fm-brand-text); }

/* ---------- filter bar + totals ---------- */
.fm-bar { background: var(--fm-surface); border-radius: var(--fm-radius-card); box-shadow: var(--fm-shadow); padding: .9rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1.5rem; align-items: start; margin-bottom: 1rem; }
.fm-bar-left { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.fm-ctrls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.fm-search { position: relative; flex: 1 1 200px; max-width: 300px; }
.fm-search input { width: 100%; padding-left: 2.1rem; }
.fm-search .barcode-search-btn { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); border: 0; padding: .1rem .4rem; line-height: 1.2; }
.fm-search .barcode-search-btn .bi { position: static; transform: none; color: inherit; pointer-events: auto; }
.fm-search:has(.barcode-search-btn) input { padding-right: 2.4rem; }
.fm-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--fm-muted); pointer-events: none; }
.fm-pill { background: var(--fm-brand-soft); color: var(--fm-brand-text); border: 1px solid transparent; border-radius: 999px; padding: .35rem .8rem; font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.fm-pill:hover { border-color: var(--fm-brand-text); }
.fm-pill .fm-count { background: var(--fm-brand); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .45rem; line-height: 1.15rem; }
.fm-menu { position: relative; }

/* chips of the active filters */
.fm-list-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.fm-list-chips:empty { display: none; }
.fm-list-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: 999px; padding: .15rem .25rem .15rem .65rem; font-size: .78rem; }
.fm-list-chip button { border: 0; background: var(--fm-brand-soft); width: 1.15rem; height: 1.15rem; border-radius: 50%; line-height: 1; padding: 0; color: var(--fm-muted); cursor: pointer; }
.fm-list-chip button:hover { color: var(--fm-alert-text); }

/* panel of the remaining filters */
.fm-filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; padding-top: .25rem; }
.fm-filter-panel[hidden] { display: none; }

/* totals widget */
.fm-totals { text-align: right; min-width: 10.5rem; display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.fm-tot-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fm-muted); font-weight: 600; }
.fm-tot-main { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.fm-tot-sel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; width: 100%; }
.fm-tot-sel > div { overflow: hidden; }
.fm-tot-sel.on { grid-template-rows: 1fr; }
.fm-tot-sel-in { margin-top: .25rem; padding-top: .5rem; border-top: 1px dashed var(--fm-line); }
.fm-tot-sel .fm-tot-label, .fm-tot-sel .fm-tot-val { color: var(--fm-brand-text); }
.fm-tot-val { font-size: 1.25rem; font-weight: 700; }
.fm-meter { height: 5px; border-radius: 3px; background: var(--fm-line); margin-top: .4rem; overflow: hidden; }
.fm-meter i { display: block; height: 100%; background: var(--fm-brand-text); width: 0; transition: width .3s ease; }

/* contextual bar of the select mode (replaces the filter controls) */
.fm-selbar { display: none; align-items: center; gap: .75rem; flex-wrap: wrap; }
body.fm-selecting .fm-selbar { display: flex; }
body.fm-selecting .fm-ctrls, body.fm-selecting .fm-filter-panel { display: none; }
.fm-selbar .fm-sel-count { font-weight: 600; }
.fm-selbar label { display: inline-flex; align-items: center; gap: .45rem; color: var(--fm-muted); margin: 0; }

/* segmented control (status tabs with counts, view switches) */
.fm-seg { display: inline-flex; flex-wrap: wrap; background: var(--fm-hover); border-radius: 999px; padding: 3px; gap: 2px; }
.fm-seg button { border: 0; background: none; border-radius: 999px; padding: .25rem .75rem; color: var(--fm-muted); font-weight: 500; display: inline-flex; gap: .3rem; align-items: center; cursor: pointer; }
.fm-seg button b { font-weight: 600; font-size: .72rem; background: var(--fm-surface); border-radius: 999px; padding: 0 .45rem; line-height: 1.15rem; color: var(--fm-ink); }
.fm-sorthead .fm-seg { font-size: .85rem; }
.fm-seg button[aria-pressed="true"] { background: var(--fm-brand); color: #fff; }
.fm-seg button[aria-pressed="true"] b { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- list card ---------- */
.fm-list-card { background: var(--fm-surface); border-radius: var(--fm-radius-card); box-shadow: var(--fm-shadow); overflow: hidden; }
.fm-sorthead { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1.1rem; border-bottom: 1px solid var(--fm-line); color: var(--fm-muted); font-size: .78rem; gap: .6rem; flex-wrap: wrap; }
.fm-sort button { border: 0; background: none; color: var(--fm-muted); font-weight: 600; padding: .1rem .3rem; cursor: pointer; }
.fm-sort button[aria-pressed="true"] { color: var(--fm-brand-text); }
/* DataTables' own footer (page length, info, paging) under the rows. The Bootstrap 5 build lays it out with
   .row / col-* classes (negative gutters, padded children): drop the gutters so the rows run edge to edge in the card,
   then make the footer one padded, vertically centred line. */
.fm-list-card div.dt-container { margin: 0; }
.fm-list-card div.dt-container > .row { --bs-gutter-x: 0; margin: 0; }
.fm-list-card div.dt-container > .row > * { padding-left: 0; padding-right: 0; }
.fm-list-card div.dt-container > .row:not(.dt-layout-table) {
  margin-top: 0; padding: .7rem 1.1rem .8rem; border-top: 1px solid var(--fm-line);
  align-items: center; gap: .5rem 1.25rem;
}
.fm-list-card div.dt-container .dt-layout-start { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.25rem; }
.fm-list-card div.dt-container .dt-layout-end { display: flex; align-items: center; }
.fm-list-card div.dt-container .dt-length label { display: inline-flex; align-items: center; gap: .5rem; margin: 0; white-space: nowrap; font-weight: 500; color: var(--fm-ink); }
.fm-list-card div.dt-container .dt-length select { width: auto; margin: 0; }
.fm-list-card div.dt-container div.dt-info { margin: 0; padding: 0; color: var(--fm-muted); font-size: .8rem; line-height: 1.3; }
.fm-list-card div.dt-container div.dt-paging { margin: 0; padding: 0; }
.fm-list-card div.dt-container .dt-paging .pagination { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .fm-list-card div.dt-container > .row:not(.dt-layout-table) { padding: .7rem .85rem .8rem; }
  .fm-list-card .dt-layout-end, .fm-list-card .dt-layout-end .dt-paging { width: 100%; }
  .fm-list-card div.dt-container .dt-paging .pagination { justify-content: center; }
}

/* The DataTable is the engine; its table renders as a plain stack of rows (header only for screen readers). */
table.fm-list-table { margin: 0; width: 100% !important; }
table.fm-list-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.fm-list-table > tbody > tr > td { padding: 0; border-bottom: 1px solid var(--fm-line); vertical-align: middle; }
table.fm-list-table > tbody > tr:last-child > td { border-bottom: 0; }
body.fm-selecting .fm-row-restore { display: none; }
table.fm-list-table > tbody > tr.fm-row-deleted { cursor: default; }
body.fm-selecting table.fm-list-table > tbody > tr { cursor: pointer; }
table.fm-list-table > tbody > tr { cursor: pointer; }
table.fm-list-table > tbody > tr:focus-visible { outline: 2px solid var(--fm-brand-text); outline-offset: -2px; }
table.fm-list-table > tbody > tr.fm-row-selected { --bs-table-bg: var(--fm-brand-soft); --bs-table-hover-bg: var(--fm-brand-soft); }
table.fm-list-table > tbody > tr.fm-row-deleted .fm-row-title,
table.fm-list-table > tbody > tr.fm-row-deleted .fm-row-amount { text-decoration: line-through; text-decoration-color: var(--fm-alert-text); }
table.fm-list-table td.dt-empty { text-align: center; color: var(--fm-muted); padding: 3rem 1rem; cursor: default; }
body.fm-selecting table.fm-list-table, body.fm-selecting table.fm-list-table * { -webkit-user-select: none; user-select: none; }

/* row grid: [checkbox] [leading visual] [main] [amount] [chevron] */
.fm-row { display: grid; grid-template-columns: 0 2.75rem minmax(0, 1fr) auto 1.1rem; align-items: center; gap: 0 .9rem; padding: .7rem 1.1rem; transition: grid-template-columns .22s ease; }
body.fm-selecting .fm-row { grid-template-columns: 1.4rem 2.75rem minmax(0, 1fr) auto 0; }
.fm-row .fm-row-check { opacity: 0; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--fm-brand); transition: opacity .15s; }
body.fm-selecting .fm-row .fm-row-check { opacity: 1; }
.fm-row-main { min-width: 0; }
.fm-row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-row-title span { color: var(--fm-muted); font-weight: 400; }
.fm-row-sub { color: var(--fm-muted); font-size: .8rem; display: flex; gap: .2rem .65rem; flex-wrap: wrap; align-items: center; margin-top: .1rem; }
.fm-row-sub .fm-num { white-space: nowrap; }
.fm-row-amount { font-weight: 700; font-size: 1.02rem; text-align: right; white-space: nowrap; display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
/* amount with a thin bar under it: its share of the largest amount on the page */
.fm-row-amount.fm-amount-col { flex-direction: column; align-items: flex-end; gap: .3rem; min-width: 6.5rem; }
.fm-share { height: 4px; width: 100%; background: var(--fm-line); border-radius: 2px; overflow: hidden; }
.fm-share i { display: block; height: 100%; background: var(--fm-brand-text); border-radius: 2px; opacity: .75; }
.fm-share-mid i { background: var(--fm-warn-text); }
.fm-share-high i { background: var(--fm-alert-text); opacity: 1; }
.fm-row-go { color: var(--fm-muted); transition: transform .15s; width: 1.1rem; overflow: hidden; }
tr:hover > td > .fm-row .fm-row-go { transform: translateX(3px); color: var(--fm-brand-text); }
body.fm-selecting .fm-row-go { visibility: hidden; }
.fm-row-restore { border: 1px solid var(--fm-brand-text); background: none; color: var(--fm-brand-text); border-radius: .5rem; padding: .1rem .55rem; font-size: .75rem; font-weight: 500; cursor: pointer; }

/* leading tiles: supplier logo or monogram (hue from a stable hash of the name), also icon tiles */
.fm-tile { width: 2.75rem; height: 2.75rem; border-radius: .75rem; border: 1px solid var(--fm-line); display: grid; place-items: center; overflow: hidden; background: #fff; flex: none; }
.fm-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fm-tile-mono { background: hsl(var(--h, 200) 42% 89%); color: hsl(var(--h, 200) 55% 27%); font-weight: 700; font-size: 1.1rem; border-color: transparent; }
[data-bs-theme="dark"] .fm-tile-mono { background: hsl(var(--h, 200) 42% 24%); color: hsl(var(--h, 200) 55% 82%); }
.fm-tile-icon { background: var(--fm-brand-soft); color: var(--fm-brand-text); font-size: 1.25rem; border-color: transparent; }
.fm-tile-sm { width: 1.5rem; height: 1.5rem; border-radius: .45rem; font-size: .75rem; }

/* tags / pills inside a row */
.fm-tag { white-space: nowrap; display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; padding: 0 .45rem; border-radius: 999px; line-height: 1.15rem; background: var(--fm-brand-soft); color: var(--fm-brand-text); }
.fm-tag-income { background: var(--fm-income-soft); color: var(--fm-income-text); }
.fm-tag-alert { background: var(--fm-alert-soft); color: var(--fm-alert-text); font-weight: 600; }
/* a tag on a selected row would vanish into the same tint: give it a hairline */
table.fm-list-table > tbody > tr.fm-row-selected .fm-tag { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }
.fm-show-xs { display: none; }
.fm-tag-muted { background: var(--fm-line); color: var(--fm-muted); }
.fm-tag-strong { font-weight: 600; }
.fm-tag-star { background: none; color: var(--fm-warn-text); padding: 0; }
.fm-tag-plain { background: none; color: var(--fm-muted); padding: 0; }
table.fm-list-table > tbody > tr.fm-row-paused .fm-tile, table.fm-list-table > tbody > tr.fm-row-paused .fm-row-title,
table.fm-list-table > tbody > tr.fm-row-ended .fm-tile, table.fm-list-table > tbody > tr.fm-row-ended .fm-row-title { opacity: .6; }
table.fm-list-table > tbody > tr.fm-row-ended .fm-row-amount { color: var(--fm-muted); }
.fm-tag-warn { background: var(--fm-warn-soft); color: var(--fm-warn-text); }
.fm-tile-ico { font-size: 1.3rem; }
.fm-tag-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: transparent; color: var(--fm-muted); padding: 0; }
.fm-att { color: var(--fm-muted); display: inline-flex; }

/* ---------- bulk bar (fixed at the bottom while selecting) ---------- */
.fm-bulk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex; justify-content: center; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px)); transform: translateY(120%); transition: transform .25s ease; pointer-events: none; }
.fm-bulk.on { transform: none; }
.fm-bulk-in { pointer-events: auto; background: var(--fm-surface); border: 1px solid var(--fm-line); box-shadow: 0 10px 40px rgba(0, 0, 0, .2); border-radius: 1.1rem; padding: .6rem .75rem .6rem 1.1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; max-width: 760px; width: 100%; }
/* a popover opening above the bulk bar (e.g. "Set paid": paid date + payment method) */
.fm-bulk-in { position: relative; }
.fm-bulk-pop { position: absolute; bottom: calc(100% + .5rem); right: .75rem; width: min(20rem, calc(100% - 1.5rem)); background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: .9rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.fm-bulk-pop-tall { max-height: min(70vh, 34rem); overflow-y: auto; }
.fm-bulk-pop[hidden] { display: none; }
.fm-bulk-pop label { font-size: .78rem; font-weight: 500; color: var(--fm-muted); margin: 0 0 .15rem; }
.fm-bulk-info { flex: 1 1 10rem; min-width: 0; }
.fm-bulk-info small { display: block; color: var(--fm-muted); }
.fm-bulk-warn { background: var(--fm-alert-soft); color: var(--fm-alert-text); border-radius: .6rem; padding: .4rem .65rem; font-size: .78rem; flex-basis: 100%; }
.fm-bulk-warn[hidden] { display: none; }

/* ---------- date range popover: presets on the left, one calendar on the right ---------- */
.fm-rp { position: absolute; top: calc(100% + .4rem); left: 0; z-index: 1050; background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: 1rem; box-shadow: var(--fm-shadow); display: flex; max-width: calc(100vw - 2rem); color: var(--fm-ink); }
.fm-rp[hidden] { display: none; }
.fm-rp-presets { display: flex; flex-direction: column; gap: 2px; padding: .6rem; border-right: 1px solid var(--fm-line); min-width: 9.5rem; }
.fm-rp-presets button { border: 0; background: none; text-align: left; padding: .45rem .65rem; border-radius: .5rem; white-space: nowrap; color: inherit; cursor: pointer; }
.fm-rp-presets button:hover { background: var(--fm-hover); }
.fm-rp-presets button[aria-current="true"] { background: var(--fm-brand-soft); color: var(--fm-brand-text); font-weight: 600; }
.fm-rp-cal { padding: .75rem .85rem .6rem; width: 17.5rem; }
.fm-rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; font-weight: 600; text-transform: capitalize; }
.fm-rp-head button { border: 0; background: var(--fm-hover); width: 1.75rem; height: 1.75rem; border-radius: .5rem; color: inherit; cursor: pointer; }
.fm-rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.fm-rp-grid .dow { font-size: .7rem; color: var(--fm-muted); text-align: center; padding: .25rem 0; }
.fm-rp-grid button { border: 0; background: none; height: 2.1rem; font-size: .8rem; padding: 0; color: inherit; cursor: pointer; }
.fm-rp-grid button.out { color: var(--fm-muted); opacity: .55; }
.fm-rp-grid button.in { background: var(--fm-brand-soft); color: var(--fm-brand-text); }
.fm-rp-grid button.today { font-weight: 700; text-decoration: underline; }
.fm-rp-grid button.edge { background: var(--fm-brand); color: #fff; border-radius: .55rem; opacity: 1; }
.fm-rp-foot { margin-top: .5rem; color: var(--fm-muted); font-size: .75rem; min-height: 1.1rem; }

/* ---------- grouped (expandable) rows, used by the consolidated lists ---------- */
/* a group row (supplier / category with its children) is not tinted as a whole: the head has its own hover */
table.fm-list-table > tbody > tr:has(.fm-group) > td { box-shadow: none !important; --bs-table-bg-state: transparent; }
.fm-group-head:hover { background: var(--fm-hover); }
.fm-group { border-bottom: 1px solid var(--fm-line); }
.fm-group:last-child { border-bottom: 0; }
.fm-group-head { width: 100%; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; }
.fm-group.open > .fm-group-head { background: var(--fm-hover); }
.fm-group-head:focus-visible { outline-offset: -2px; }
.fm-group-head[aria-expanded="true"] .fm-row-go { transform: rotate(90deg); }
.fm-group-body { padding: 0 1.1rem .8rem 4.75rem; display: none; }
.fm-group.open > .fm-group-body { display: block; }
.fm-group-body .fm-group-item { display: flex; align-items: center; gap: .75rem; padding: .45rem .6rem; border-radius: .6rem; color: inherit; text-decoration: none; }
.fm-group-body .fm-group-item:hover { background: var(--fm-hover); }
.fm-group-scroll { max-height: 18rem; overflow-y: auto; }
.fm-group-hit { background: color-mix(in srgb, var(--fm-warn-soft) 70%, transparent); border-radius: .2rem; }

/* ---------- consolidated lists: supplier rows with their branches (phase 7) ---------- */
.fm-tot-sub { color: var(--fm-muted); font-size: .8rem; margin-top: .1rem; }
.fm-cc { font-size: .7rem; font-weight: 600; letter-spacing: .04em; background: var(--fm-hover); color: var(--fm-muted); border-radius: .4rem; padding: .05rem .4rem; white-space: nowrap; }
.fm-meta { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fm-subhead { display: flex; justify-content: space-between; align-items: center; padding: .1rem .6rem .25rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fm-muted); font-weight: 600; }
.fm-opens { border: 0; background: none; color: var(--fm-brand-text); font-weight: 600; font-size: .8rem; letter-spacing: 0; text-transform: none; padding: .1rem .4rem; border-radius: .5rem; text-decoration: none; }
.fm-opens:hover { background: var(--fm-brand-soft); color: var(--fm-brand-text); }
.fm-subs { border-left: 2px solid var(--fm-line); display: flex; flex-direction: column; }
.fm-addb { margin: .35rem 0 .35rem .6rem; align-self: flex-start; border: 1px dashed var(--fm-brand-text); background: none; color: var(--fm-brand-text); border-radius: .6rem; padding: .3rem .75rem; font-weight: 500; text-decoration: none; }
.fm-addb:hover { background: var(--fm-brand-soft); color: var(--fm-brand-text); }
.fm-btools { display: flex; gap: .5rem .75rem; flex-wrap: wrap; align-items: center; padding: .25rem .6rem .5rem; }
.fm-bsearch { position: relative; flex: 1 1 12rem; max-width: 17rem; margin: 0; }
.fm-bsearch input { width: 100%; padding-left: 1.9rem; font-size: .85rem; }
.fm-bsearch .bi { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--fm-muted); pointer-events: none; font-size: .8rem; }
.fm-bchips { display: flex; gap: .35rem; flex-wrap: wrap; }
.fm-bchips button { border: 1px solid var(--fm-line); background: var(--fm-surface); border-radius: 999px; padding: .05rem .6rem; font-size: .75rem; color: var(--fm-muted); font-weight: 500; cursor: pointer; }
.fm-bchips button b { color: var(--fm-ink); font-weight: 600; margin-left: .2rem; }
.fm-bchips button[aria-pressed="true"] { background: var(--fm-brand); border-color: var(--fm-brand); color: #fff; }
.fm-bchips button[aria-pressed="true"] b { color: #fff; }
.fm-blist.fm-group-scroll { max-height: 22rem; }
.fm-more { margin: .25rem 0 0 .6rem; border: 0; background: none; color: var(--fm-brand-text); font-weight: 600; padding: .35rem .25rem; cursor: pointer; }
.fm-more:hover { text-decoration: underline; }
.fm-nob { color: var(--fm-muted); padding: .5rem .6rem; font-size: .85rem; }
.fm-brow { cursor: pointer; }
.fm-brow .fm-pin { color: var(--fm-brand-text); }
.fm-brow-name { font-weight: 600; }
.fm-brow-addr { color: var(--fm-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-brow.fm-row-deleted .fm-brow-name { text-decoration: line-through; text-decoration-color: var(--fm-alert-text); }
.fm-desc { color: var(--fm-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fm-star { color: var(--fm-warn-text); display: inline-flex; font-size: .8rem; }
.fm-row-arch .fm-tile, .fm-brow-arch .fm-brow-name { opacity: .6; }
.fm-brow-arch { opacity: .8; }
mark.fm-hit { background: color-mix(in srgb, var(--fm-warn-soft) 80%, transparent); color: inherit; border-radius: .2rem; padding: 0 .1rem; }
.fm-view-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; width: 100%; }

/* ---------- phone: two-line cards, totals stay visible ---------- */
@media (max-width: 640px) {
  .fm-hide-xs { display: none; }
  .fm-show-xs { display: inline; }
  .fm-sorthead .fm-seg { width: 100%; flex-wrap: nowrap; }
  .fm-seg button { flex: 1 1 0; justify-content: center; padding: .25rem .35rem; }
  .fm-bar { grid-template-columns: 1fr; }
  .fm-totals { order: -1; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: .25rem 1.1rem; }
  .fm-tot-sel { width: auto; display: none; }
  .fm-tot-sel.on { display: block; }
  .fm-tot-sel-in { margin: 0; padding: 0; border: 0; }
  .fm-tot-main { font-size: 1.55rem; }
  .fm-row { grid-template-columns: 0 2.5rem minmax(0, 1fr) auto 0; gap: 0 .65rem; padding: .7rem .85rem; }
  body.fm-selecting .fm-row { grid-template-columns: 1.4rem 2.5rem minmax(0, 1fr) auto 0; }
  .fm-tile { width: 2.5rem; height: 2.5rem; }
  .fm-row-amount.fm-amount-col { min-width: 5.25rem; }
  .fm-row-go { display: none; }
  .fm-search { max-width: none; }
  .fm-rp { flex-direction: column; }
  .fm-rp-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--fm-line); }
  .fm-rp-cal { width: 100%; }
  .fm-group-body { padding-left: .85rem; padding-right: .5rem; }
  .fm-group > .fm-row .fm-meta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fm-row, .fm-row .fm-row-check, .fm-tot-sel, .fm-meter i, .fm-bulk, .fm-row-go { transition: none !important; }
}
.fm-co { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- product units: a wider symbol tile, a sample quantity and the decimals as dots ---------- */
.fm-row.fm-row-sym { grid-template-columns: 0 3.5rem minmax(0, 1fr) auto 1.1rem; }
.fm-tile-sym { width: 3.5rem; font-size: .95rem; letter-spacing: .01em; }
.fm-ex { font-variant-numeric: tabular-nums; color: var(--fm-muted); font-size: .8rem; }
.fm-ex b { color: var(--fm-ink); font-weight: 600; }
.fm-sub-el { color: var(--fm-muted); font-weight: 400; }
.fm-dots { display: inline-flex; gap: .2rem; align-items: center; }
.fm-dots i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--fm-line); }
.fm-dots i.on { background: var(--fm-brand-text); }
@media (max-width: 640px) {
  .fm-row.fm-row-sym { grid-template-columns: 0 3rem minmax(0, 1fr) auto 0; }
  .fm-tile-sym { width: 3rem; height: 2.5rem; }
}
