/* R3 candidate only: make the five optional filters compact on phones.
   R2 remains the base stylesheet.  This file intentionally has no desktop,
   API, permission, billing, or data selector. */

@media (max-width: 760px) {
  .notebook-page[data-library-layout="r2"] .nb-library-filter-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    /* R2 makes the filter container a two-column grid.  This phone-only
       wrapper must span both columns, otherwise the summary gets squeezed
       into half a row beside an empty grid cell. */
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-disclosure {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-disclosure > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    list-style: none;
    cursor: pointer;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 600;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-disclosure > summary::-webkit-details-marker {
    display: none;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-disclosure > summary::after {
    margin-left: auto;
    color: var(--color-text-secondary);
    content: "⌄";
    font-size: 18px;
    line-height: 1;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-disclosure[open] > summary {
    border-bottom: 1px solid var(--color-border);
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-options .ant-select {
    width: 100%;
    min-width: 0;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-options .ant-select-selector {
    min-height: 44px !important;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-options .ant-select-selection-item {
    font-size: 16px;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-options > .ant-select:last-child {
    grid-column: 1 / -1;
  }

  .notebook-page[data-library-layout="r2"] .nb-library-filter-clear {
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
  }
}
