/* ── Bike to Work: the filter chips over the order list ─────────────────────
   One chip per filter (invoices-core.js, B2W_FILTERS), each with a coloured
   dot, its name and how many orders it holds. They replace the dropdown the
   page header had. A chip's colour is the colour its orders' badge has in the
   list: red for what needs attention or is overdue, blue for the deal moving
   along, amber for drafts and unpaid, green for handed over and paid. */
.b2w-filters {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    margin: 0 0 var(--sp-3);
}
.b2w-filters:empty { display: none; }
.b2w-chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    min-height: 38px; padding: 0.3rem 0.8rem;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-card); color: var(--text);
    font: inherit; font-size: 0.85rem; font-weight: 500; line-height: 1.2;
    white-space: nowrap; cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.b2w-chip::before {
    content: ''; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%;
    background: var(--tone, var(--text-muted));
}
.b2w-chip-count { font-weight: 700; color: var(--tone, var(--text)); }
.b2w-chip--danger { --tone: var(--danger);  --tone-soft: var(--danger-soft); }
.b2w-chip--warn   { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.b2w-chip--ready  { --tone: var(--success); --tone-soft: var(--success-soft); }
.b2w-chip--info   { --tone: var(--accent);  --tone-soft: var(--accent-soft); }
.b2w-chip:hover { border-color: var(--tone, var(--accent)); }
.b2w-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The one showing: filled in its own colour, All in the accent. */
.b2w-chip.is-on {
    background: var(--tone-soft, var(--accent-soft));
    border-color: var(--tone, var(--accent));
    box-shadow: 0 0 0 1px var(--tone, var(--accent));
    font-weight: 600;
}
/* A filter with nothing under it fades, as Repairs' tiles do. */
.b2w-chip.is-zero:not(.is-on) { color: var(--text-muted); }
.b2w-chip.is-zero:not(.is-on)::before { opacity: 0.4; }
.b2w-chip.is-zero .b2w-chip-count { color: var(--text-muted); font-weight: 600; }

/* A tablet or phone: a finger high. */
@media (pointer: coarse) {
    .b2w-chip { min-height: 44px; padding-inline: 0.9rem; font-size: 0.9rem; }
}
/* A phone: one row that slides sideways, so nine chips don't push the list
   down the screen. */
@media (max-width: 639px) {
    .b2w-filters {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 4px;
    }
    .b2w-chip { flex: none; }
}
