@media (max-width: 767px) {
  /* Keep the visible chevron small while providing a finger-sized target. */
  .chat-filters-toolbar .chat-filters-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: 4px solid transparent;
    border-radius: 12px;
    background-clip: padding-box;
  }

  div.chat-filters-toolbar {
    gap: 4px;
    padding-block: 0;
  }

  .chat-filters-toolbar > button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Use the disclosure row for search instead of leaving an empty strip. */
  .chat-filters-toolbar > div { display: flex; }
  .chat-filters-toolbar input[type='search'] {
    height: 40px;
    font-size: 16px;
  }

  /* Preserve the title and every action on narrow screens. */
  .whatsapp-header .header-right { gap: 2px; }
  .whatsapp-header .header-title { gap: 0; }
  .whatsapp-header .header-title > svg,
  .whatsapp-header .header-time,
  .whatsapp-header .header-right > button:has(> .lucide-search) { display: none; }
  .whatsapp-header .header-title > h1 { font-size: 16px; }

  /* Search now lives in the filter toolbar; remove the old collapsed field
     from keyboard and screen-reader navigation as well. */
  .whatsapp-header > .transition-all:has(input[type='search']) { display: none; }

  .whatsapp-header .incognito-toggle {
    min-width: 44px;
    height: 36px;
    padding: 4px 6px;
  }

  .whatsapp-header .incognito-toggle > span:first-child { display: none; }
}

@media (max-width: 359px) {
  /* Seven columns would make the controls narrower than 44px. */
  .chat-filters-panel > .grid {
    /* Older published chat bundles also set seven columns inline. */
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    row-gap: 4px;
  }
}
