/* ==========================================================================
   TSF LISTING ARCHIVE TOOLBAR
   Companion to listing-toolbar.php and js/tsf-listing-toolbar.js.

   Replaces the Elementor archive template's sticky facet stack, which styled
   FacetWP from two copies of the same custom_css blob (one on the desktop
   container, one on the mobile accordion) using `!important` on `#000`
   backgrounds and hardcoded 225px control widths. Everything here is token-
   driven and sized in fractions of the space available.

   SPECIFICITY NOTE: `.tsf-lt .facetwp-*` (0,2,0) outranks MOST of FacetWP's own
   rules (0,1,0), so nothing below needs !important. NOT all of them: front.css
   also carries type-qualified `.facetwp-facet input.facetwp-*` rules at (0,2,1),
   which quietly win, and one of those hid the proximity radius picker completely
   — see the min-width override in the control skin. Where that happens the rule
   here is qualified up to (0,3,1) and says why. So if a rule here stops winning,
   check front.css for a type-qualified twin BEFORE assuming leftover Elementor
   custom_css in the database — and if it is that, delete the widget, don't
   escalate the selector.
   ========================================================================== */

/* ==========================================================================
   NOTHING HERE IS STICKY. Read this before making anything sticky again.

   This bar and the site header were both trying to own the top of the viewport,
   and the bar's sticky offset tracked the header's live bottom edge, so every
   header slide dragged the bar around with it. Worst right at the top of the
   page — where the header transitions most, and where it costs the reader most.

   Four attempts, each of which removed one mechanism and left another:
     1. hysteresis on the compact state, so it stopped flip-flopping;
     2. measuring the header's painted rect instead of modelling its class;
     3. a single-row compact state, to cut the bar's stuck height;
     4. a claim protocol handing the top to whichever bar was stuck.

   The last one suppressed the header's scroll-up REVEAL but not its scroll-down
   HIDE, and the hide fires as `y` crosses the header's height — the same ~100px
   band where the bar crosses its own resting position. Two elements negotiating
   over one piece of screen; the negotiation was the bug, not any single rule.

   So both are static, at every width. Removed with the sticky: --tsf-lt-top,
   .tsf-lt-host.is-stuck and everything it restyled, the compact-state size
   transitions, and the shortcode's `offset` attribute. The header lost its
   fixed positioning, spacer, scroll listener and --tsf-hdr-top to match.

   .tsf-lt-host itself is KEPT — the JS still adds it to the nearest
   .elementor-widget ancestor, and the chips/badge/heading wiring hangs off it.
   It just no longer positions anything.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    #tsf-dynamic-heading.tsf-archive-heading { transition: none; }
}

/* --------------------------------------------------------------------------
   SHELL
   -------------------------------------------------------------------------- */
.tsf-lt {
    --tsf-lt-ctl: 42px;   /* control height — shrinks when stuck */
    --tsf-lt-pad: 18px;
    --tsf-lt-radius-w: 104px;  /* radius picker + the WITHIN label above it */

    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--tsf-lt-pad) 0;
    background: var(--tsf-bg, #131313);
    color: var(--tsf-text, #CBCBCB);
    font-family: var(--tsf-font-body, "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
    transition: padding 200ms ease-in-out;
}

.tsf-lt *,
.tsf-lt *::before,
.tsf-lt *::after { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   HEAD — row 1 is the heading + result count with the Filters button pushed to
   the right edge (the button only exists below 1024px); row 2 is the
   listing-type tab strip.
   -------------------------------------------------------------------------- */
.tsf-lt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}

/* flex-basis 0, not auto. With `auto` the basis is the heading's max-content
   width — far wider than a phone — so the Filters button never fits beside it
   and wraps to a row of its own, which in the stuck state costs more height than
   the heading itself. Basis 0 + min-width 0 lets the heading take whatever is
   left after the button and wrap inside it. */
.tsf-lt-headline {
    flex: 1 1 0;
    min-width: 0;
}

/* Scoped on the id because the Elementor heading widget's own custom_css
   (`selector h1.tsf-archive-heading { font-size: 3vw }`, plus four media
   queries) is (0,2,1) and would otherwise win for as long as that widget still
   exists in the template. Deleting the widget takes its CSS with it. */
#tsf-dynamic-heading.tsf-archive-heading {
    margin: 0;
    font-family: var(--tsf-font-display, "Scare Factor Custom", "Bebas Neue", sans-serif);
    font-weight: 400;
    /* Replaces a flat 3vw / 4.7vw: viewport-proportional type has no floor on a
       phone and no ceiling on a 34" monitor. */
    font-size: clamp(1.45rem, 3.2vw, 2.75rem);
    line-height: var(--tsf-leading-tight, 1.2);
    letter-spacing: 1px;
    color: var(--tsf-nav-text, #F3F3F3);
}

.tsf-lt-count {
    margin: 5px 0 0;
    font-size: var(--tsf-size-xs, 0.82rem);
    color: var(--tsf-text-muted, #8A8A8A);
}
.tsf-lt-count b { color: var(--tsf-text-strong, #F2F2F2); font-weight: 700; }
.tsf-lt-count[hidden] { display: none; }

/* --------------------------------------------------------------------------
   LISTING-TYPE TABS
   -------------------------------------------------------------------------- */
/* Full width on its own line at every size, rather than tucked beside the
   heading on desktop. Sharing the row cost the H1 about half its width, which
   wrapped "Find Haunted Houses in Ohio Near You!" onto two lines for the sake of
   a row that ended up the same height anyway. Same layout everywhere is also one
   less thing to keep working at two breakpoints. */
.tsf-lt-types {
    flex: 1 1 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    order: 3;
}

/* --------------------------------------------------------------------------
   FILTERS TOGGLE (below 1024px only)
   -------------------------------------------------------------------------- */
.tsf-lt-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--tsf-lt-ctl);
    padding: 0 16px;
    background: var(--tsf-surface-panel, #1A1A1A);
    border: 1px solid var(--tsf-line-strong, #333333);
    border-radius: var(--tsf-radius-xl, 31px);
    color: var(--tsf-text-strong, #F2F2F2);
    font: inherit;
    font-size: var(--tsf-size-xs, 0.82rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tsf-tracking-wide, 0.5px);
    cursor: pointer;
}
.tsf-lt-toggle:hover { border-color: var(--tsf-red, #FF0000); }
.tsf-lt-toggle:focus-visible { outline: 2px solid var(--tsf-red, #FF0000); outline-offset: 2px; }

.tsf-lt-toggle svg {
    width: 18px; height: 18px; flex: 0 0 auto;
    fill: none; stroke: var(--tsf-red, #FF0000);
    stroke-width: 2; stroke-linecap: round;
}

.tsf-lt-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px;
    background: var(--tsf-red, #FF0000);
    color: var(--tsf-text-bright, #FFFFFF);
    font-size: 11px; letter-spacing: 0;
}
.tsf-lt-badge[hidden] { display: none; }

/* --------------------------------------------------------------------------
   FILTER PANEL
   Below 1024px the panel is capped and scrolls internally. That cap is what
   makes a sticky bar safe on a phone: an accordion that can grow past the
   viewport would pin the entire screen once it is stuck.
   -------------------------------------------------------------------------- */
.tsf-lt-panel { display: none; }

.tsf-lt.is-open .tsf-lt-panel {
    display: block;
    max-height: min(68vh, 520px);
    overflow-y: auto;
    padding: 2px 2px 4px;
}

/* The whole responsive story, in one declaration: as many 220px-or-wider columns
   as fit, each field one column, Name two.

   auto-FILL, not auto-fit. auto-fit collapses the leftover empty tracks and
   redistributes their width, so a row holding a single wrapped field stretches
   it edge to edge — a lone 750px-wide <select> on a tablet. auto-fill keeps the
   empty tracks, so a wrapped field stays the same width as the ones above it.
   (This is also why it isn't flexbox: flex-grow has the same orphan-stretch
   problem and no way to opt out per row.) */
.tsf-lt-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-items: end;
    gap: 10px 12px;
}

.tsf-lt-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}
/* Name and proximity both take a double track.
   Proximity is TWO controls sharing one: the radius picker is a fixed 104px
   (--tsf-lt-radius-w) plus an 8px gap, so on a five-column panel the place
   input was left with ~125px of a 237px track. Not just tight — the locate-me
   crosshair is pinned to the wrap's right edge, so it landed ON TOP of a
   placeholder already truncated to "Enter ZIP or Ci...". The second track puts
   the place input at ~375px, which is the point; Name keeps its own two so the
   two text fields still read as a matched pair.

   Keyed off the facet TYPE with :has() rather than a field class, matching the
   checkbox rule below: proximity is rendered without a modifier class by both
   tsf_lt_field() callers, and this way the directory bar and the holiday
   toolbar pick it up from one rule. */
.tsf-lt-field--name,
.tsf-lt-field:has(.facetwp-type-proximity) { grid-column: span 2; }

.tsf-lt-label {
    font-size: var(--tsf-size-3xs, 0.72rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tsf-tracking-caps, 0.12em);
    color: var(--tsf-red, #FF0000);
}

/* Subtype facets: exactly one is relevant per directory. The server sets
   data-tsf-lt-type from the URL; the JS re-sets it from the checked
   listing_type boxes after every refresh. */
.tsf-lt-field--sub { display: none; }
.tsf-lt[data-tsf-lt-type="haunted-houses"] .tsf-lt-field--sub[data-sub="haunted-houses"],
.tsf-lt[data-tsf-lt-type="haunted-places"] .tsf-lt-field--sub[data-sub="haunted-places"],
.tsf-lt[data-tsf-lt-type="spooky-spots"]   .tsf-lt-field--sub[data-sub="spooky-spots"] {
    display: flex;
}

/* A subtype facet set to CHECKBOXES takes the whole row rather than one 220px
   grid track — haunt_type alone has 22 terms, and stacking those into a single
   column would make the panel taller than the viewport. Keyed off the facet type
   with :has() rather than off the field, so ghost_type and category are
   unaffected while they remain dropdowns, and pick this up automatically if they
   are ever switched too.

   NOT scoped to .tsf-lt-field--sub, which is what it read at first. That worked
   only because the directory bar happens to tag its checkbox facets as subtypes.
   [tsf_holiday_toolbar] renders haunt_type as a plain field, so the rule missed
   it, and twenty-two pills wrapped inside a single 220px grid track — one pill
   per line, a filter panel taller than the results. Any checkbox facet in the
   panel takes the row; that is a property of the CONTROL, not of which bar it
   happens to be sitting in. */
.tsf-lt-field:has(.facetwp-type-checkboxes) {
    grid-column: 1 / -1;
}

/* Slightly tighter than the listing_type / holiday tab strip: those are pills
   that want presence, this is a set of twenty that wants to fit. */
.tsf-lt-panel .facetwp-checkbox { padding: 0 11px; }

/* ==========================================================================
   FACETWP CONTROL SKIN
   ========================================================================== */

.tsf-lt .facetwp-facet { margin: 0; }

.tsf-lt .facetwp-search,
.tsf-lt .facetwp-location,
.tsf-lt select.facetwp-dropdown,
.tsf-lt select.facetwp-radius {
    width: 100%;
    height: var(--tsf-lt-ctl);
    padding: 0 12px;
    background-color: var(--tsf-surface-raised, #151515);
    color: var(--tsf-text-strong, #F2F2F2);
    border: 1px solid var(--tsf-line-soft, #2A2A2A);
    border-radius: var(--tsf-radius-sm, 8px);
    font: inherit;
    font-size: var(--tsf-size-xs, 0.82rem);
    line-height: normal;
    transition: border-color var(--tsf-transition, 180ms ease-in-out);
}

/* FacetWP floors both text inputs at `min-width: 240px`. That rule is
   `.facetwp-facet input.facetwp-location` (0,2,1) — it outranks the (0,2,0)
   selectors above, which is the exception the note at the top of this file now
   warns about, so it is overridden here rather than assumed away.

   Left standing it was not a sizing nit, it was a PAINT-OVER. Proximity is a
   flex row of [input wrap | radius select]; the wrap shrinks with its grid
   track, but the input inside it refuses to follow below 240px, so it spills out
   of the wrapper to the right. And because the wrap is position:relative while
   the select is not, the spill paints in the positioned layer — ON TOP of the
   select. In a five-column panel the track is ~230px, which buried the radius
   control entirely: invisible, and unclickable everywhere the two overlapped.
   The tell was the locate-me crosshair, which is pinned to the WRAP's right edge
   and so sat marooned in the middle of the box instead of at its end. */
.tsf-lt .facetwp-facet input.facetwp-search,
.tsf-lt .facetwp-facet input.facetwp-location { min-width: 0; }

.tsf-lt .facetwp-search::placeholder,
.tsf-lt .facetwp-location::placeholder { color: var(--tsf-text-muted, #8A8A8A); }

.tsf-lt .facetwp-search:hover,
.tsf-lt .facetwp-location:hover,
.tsf-lt select.facetwp-dropdown:hover,
.tsf-lt select.facetwp-radius:hover { border-color: var(--ha-line-hover, #666666); }

.tsf-lt .facetwp-search:focus,
.tsf-lt .facetwp-location:focus,
.tsf-lt select.facetwp-dropdown:focus,
.tsf-lt select.facetwp-radius:focus {
    outline: 2px solid var(--tsf-red, #FF0000);
    outline-offset: 1px;
    border-color: var(--tsf-red, #FF0000);
}

/* Native select chrome is light-on-light in a dark bar, so it is replaced with
   a drawn caret. The `#` in the fill colour must stay percent-encoded (%23) —
   an unescaped one truncates the data URI at the fragment. */
.tsf-lt select.facetwp-dropdown,
.tsf-lt select.facetwp-radius {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23FF3B3B' d='M0 0h12L6 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
    cursor: pointer;
}

/* Windows and Linux render the popup list from the element's own colours, not
   the page's, so an unstyled option list comes back white. */
.tsf-lt select option {
    background-color: var(--tsf-surface-raised, #151515);
    color: var(--tsf-text-strong, #F2F2F2);
}

/* Search + proximity both wrap their input so FacetWP can absolutely position
   its magnifier / locate-me icon over it. */
.tsf-lt .facetwp-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.tsf-lt .facetwp-input-wrap .facetwp-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    margin: 0;
    cursor: pointer;
}
.tsf-lt .facetwp-search,
.tsf-lt .facetwp-location { padding-right: 34px; }

/* Proximity is two controls on one line: place, then radius. */
.tsf-lt .facetwp-type-proximity {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tsf-lt .facetwp-type-proximity .facetwp-input-wrap { flex: 1 1 auto; min-width: 0; }

/* The radius picker reads as ITS OWN control. Skinned off the same block as
   .facetwp-location it was a second box of identical height, fill, border and
   corner sitting 8px from the first with nothing labelling it — one long field,
   to anyone who had not been told otherwise. So it takes the panel fill and the
   stronger border the pills and chips use elsewhere in this bar; in this palette
   that pairing is what "this opens something" looks like, and a text input is
   not one. Height and corner stay matched to the input so the row still lines up.

   Width is a variable because the WITHIN label below is a spacer of exactly the
   same width — change one alone and the label drifts off what it names. */
.tsf-lt select.facetwp-radius {
    flex: 0 0 var(--tsf-lt-radius-w, 104px);
    width: var(--tsf-lt-radius-w, 104px);
    background-color: var(--tsf-surface-panel, #1A1A1A);
    border-color: var(--tsf-line-strong, #333333);
    font-weight: 700;
}

/* ...and it gets its own caps label, sharing the field's label row: NEAR at the
   left over the place input, WITHIN at the right over the picker.

   Generated content rather than a second <span> out of tsf_lt_field() because
   FacetWP replaces .facetwp-facet's markup after every refresh — a label
   rendered inside the facet would survive until the first filter click and no
   longer. .tsf-lt-label is ours and sits outside the facet, so it persists.

   Nothing is lost to a screen reader: .tsf-lt-label is already aria-hidden, and
   the select is named by nameRadiusControl() in js/tsf-listing-toolbar.js, which
   re-applies it on every facetwp-loaded for the same reason.

   :has() keys the label to the control actually being there, so switching the
   facet's Radius UI to Slider or None in FacetWP takes the label with it instead
   of leaving a caption over nothing. */
.tsf-lt-field:has(select.facetwp-radius) > .tsf-lt-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.tsf-lt-field:has(select.facetwp-radius) > .tsf-lt-label::after {
    content: "Within";
    flex: 0 0 var(--tsf-lt-radius-w, 104px);
    padding-left: 12px;  /* matches the select's text inset, so the two align */
}

/* -----------------------------------------------------------------------
   CHECKBOXES -> PILLS
   FacetWP ships checkboxes as a stacked list with a background-image tick and
   a left indent. In a toolbar that is both tall and visually noisy, so the
   background shorthand resets the glyph and the indent goes back to normal.
   ----------------------------------------------------------------------- */
.tsf-lt .facetwp-type-checkboxes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tsf-lt .facetwp-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 14px;
    height: var(--tsf-lt-ctl);
    background: var(--tsf-surface-panel, #1A1A1A);
    border: 1px solid var(--tsf-line-strong, #333333);
    border-radius: var(--tsf-radius-xl, 31px);
    color: var(--tsf-text, #CBCBCB);
    font-size: var(--tsf-size-2xs, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tsf-tracking-wide, 0.5px);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--tsf-transition, 180ms ease-in-out),
                border-color var(--tsf-transition, 180ms ease-in-out),
                color var(--tsf-transition, 180ms ease-in-out);
}

.tsf-lt .facetwp-checkbox:hover {
    border-color: var(--tsf-red, #FF0000);
    color: var(--tsf-text-bright, #FFFFFF);
}

.tsf-lt .facetwp-checkbox.checked {
    background: var(--tsf-red, #FF0000);
    border-color: var(--tsf-red, #FF0000);
    color: var(--tsf-text-bright, #FFFFFF);
}

.tsf-lt .facetwp-checkbox.disabled {
    opacity: 0.4;
    cursor: default;
}

.tsf-lt .facetwp-counter { font-weight: 400; opacity: 0.6; }
.tsf-lt .facetwp-checkbox.checked .facetwp-counter { opacity: 0.75; }

.tsf-lt .facetwp-toggle,
.tsf-lt .facetwp-hidden + .facetwp-toggle {
    display: inline-block;
    color: var(--ha-link, #FF6B6B);
    font-size: var(--tsf-size-2xs, 0.75rem);
    cursor: pointer;
}

/* A facet whose name no longer exists in FacetWP renders an empty wrapper;
   without this its label would sit above nothing. :has() is live, so the field
   reappears the moment a refresh fills the facet in. */
.tsf-lt .tsf-lt-field:has(> .facetwp-facet:empty) { display: none; }

/* ==========================================================================
   ACTIVE FILTER CHIPS
   Built client-side from the rendered facets — no "Selections" facet to create
   in the FacetWP UI, and nothing to keep in sync when a facet is added.
   ========================================================================== */
.tsf-lt-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--tsf-line-soft, #2A2A2A);
}
.tsf-lt-chips[hidden] { display: none; }

.tsf-lt-chips-label {
    font-size: var(--tsf-size-3xs, 0.72rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tsf-tracking-caps, 0.12em);
    color: var(--tsf-text-muted, #8A8A8A);
}

.tsf-lt-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 12px;
    background: var(--tsf-surface-panel, #1A1A1A);
    border: 1px solid var(--tsf-line-strong, #333333);
    border-radius: var(--tsf-radius-xl, 31px);
    color: var(--tsf-text, #CBCBCB);
    font: inherit;
    font-size: var(--tsf-size-2xs, 0.75rem);
    line-height: 1.4;
    cursor: pointer;
}
.tsf-lt-chip:hover { border-color: var(--tsf-red, #FF0000); color: var(--tsf-text-bright, #FFFFFF); }
.tsf-lt-chip:focus-visible { outline: 2px solid var(--tsf-red, #FF0000); outline-offset: 2px; }
.tsf-lt-chip .x { font-size: 14px; line-height: 1; color: var(--tsf-red, #FF0000); }

.tsf-lt-clear {
    padding: 4px 6px;
    background: none;
    border: 0;
    color: var(--tsf-text-muted, #8A8A8A);
    font: inherit;
    font-size: var(--tsf-size-2xs, 0.75rem);
    text-decoration: underline;
    cursor: pointer;
}
.tsf-lt-clear:hover { color: var(--tsf-red, #FF0000); }
.tsf-lt-clear:focus-visible { outline: 2px solid var(--tsf-red, #FF0000); outline-offset: 2px; }

/* ==========================================================================
   BREAKPOINTS
   1024px is the pivot the rest of the archive already uses (the card grid drops
   to two columns there, and HA_Filter_Sidebar docks/undocks on the same line).
   ========================================================================== */

/* --- Desktop: panel is always open, no toggle --- */
@media (min-width: 1024px) {
    .tsf-lt-toggle { display: none; }

    .tsf-lt-panel {
        display: block;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .tsf-lt-head { align-items: flex-start; }
}

/* --- Below 1024px: heading + toggle share row 1, type tabs get row 2 --- */
@media (max-width: 1023px) {
    /* Three pills can outgrow a narrow phone; let them scroll sideways rather
       than wrap into a second and third line inside a sticky bar. */
    .tsf-lt-types {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .tsf-lt-types::-webkit-scrollbar { display: none; }

    /* Scoped to the TYPE STRIP, and it has to stay that way. This used to read
       `.tsf-lt .facetwp-type-checkboxes`, which was harmless only while
       listing_type was the sole checkbox facet on the page. The moment a subtype
       facet is switched to checkboxes, that selector laid its 20-plus pills out
       in a single unwrappable line — and the horizontal scroller above is on
       .tsf-lt-types, so nothing inside the panel could scroll to reach them. */
    .tsf-lt-types .facetwp-type-checkboxes { flex-wrap: nowrap; }

}

@media (max-width: 600px) {
    .tsf-lt { --tsf-lt-ctl: 40px; --tsf-lt-pad: 14px; }
    .tsf-lt-toggle { padding: 0 12px; }

    /* One column, and the double-track fields have to stop spanning two — a
       span wider than the explicit grid would create an implicit second column
       and reintroduce the horizontal overflow this whole layout exists to
       avoid. Proximity is one of them now, so it resets alongside Name. */
    .tsf-lt-fields { grid-template-columns: 1fr; }
    .tsf-lt-field--name,
    .tsf-lt-field:has(.facetwp-type-proximity) { grid-column: auto; }

    /* Insurance, not the primary control. Twenty-two pills two-per-row is ~11
       rows, which would own the panel on a phone. FacetWP's own "Show more"
       limit is the better fix and is already skinned (.facetwp-toggle below) —
       this just guarantees the panel stays usable if that is left unset. */
    .tsf-lt-field:has(.facetwp-type-checkboxes) .facetwp-type-checkboxes {
        max-height: 168px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}
