/* ─────────────────────────────────────────────────────────────────────────
   LIST SEARCH — the one "Search …" box on a list (METIS-pub#869).

   crm/partials/_list_search.html, in a .list-toolbar after the filters and
   before .list-toolbar__spacer. The same pill as a toolbar field
   (.list-toolbar__field): --toolbar-h tall, the full radius and border, the
   magnifier inside at the start; a fixed width of about 24 characters.

     .list-search          the pill (role="search")
     .list-search__icon    the magnifier
     .list-search__input   the input itself, borderless inside the pill

   Never .search-input: crm/css/search.css styles that on every page for the
   search results page (flex: 1, a larger size).

   A phone: the box takes a full-width row of its own, first in the toolbar,
   and stays visible while the rest folds behind "Filters"
   (.list-toolbar--folds, crm/css/connections.css).

   Tokens only.
   ───────────────────────────────────────────────────────────────────────── */

@layer components {
  .list-search {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    inline-size: calc(var(--space-16) * 3.5);
    max-inline-size: 100%;
    height: var(--toolbar-h);
    padding-inline: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text);
  }

  .list-search:focus-within { border-color: var(--color-accent); }

  .list-search__icon {
    flex: none;
    opacity: 0.55;
  }

  .list-search__input {
    flex: 1;
    min-inline-size: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: var(--text-sm);
  }

  .list-search__input::placeholder { color: var(--color-text-muted); }

  /* A phone: a row of its own, first, never folded away. */
  @media (max-width: 767.98px) {
    .list-toolbar > .list-search {
      flex-basis: 100%;
      order: -1;
      inline-size: auto;
    }

    /* Beats connections.css's fold, which hides every child but the Filters
       button and + Add while the toolbar is closed. */
    .list-toolbar.list-toolbar--folds:not(.list-toolbar--open) > .list-search { display: inline-flex; }
  }
}
