/* Filter & sort: the toolbar button and its dialog (js/features/filter-sheet.js), a bottom sheet on phones.
   Files in css/ load in name order (index.html); later files win on equal selectors. */
.filter-btn {
  height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 13px; border-radius: 14px; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s;
}
.filter-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.filter-btn[aria-pressed="true"] { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--holo) border-box; border: 1.5px solid transparent; }
.filter-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  font: 800 10.5px/1 var(--mono); color: #14121f; background: var(--holo);
}
.filter-badge[hidden] { display: none; }
@media (hover: hover) { .filter-btn:hover { border-color: var(--border-2); } }

.filter-dlg .rl-card { width: min(520px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.filter-dlg .v2-title { margin-bottom: 4px; padding-right: 44px; }
.fs-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 0 -26px; padding: 0 26px 4px; overscroll-behavior: contain; }
.fs-body .mini-label { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 9px; }
.fs-body .mini-label small { font: 600 11px/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--faint); }
.fs-clear { border: 0; background: none; padding: 4px 0; cursor: pointer; font: 700 12px/1 var(--font); color: var(--brand); }

.fs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-chip {
  height: 38px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-weight: 650; font-size: 13px;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.fs-chip.on { color: var(--bg); background: var(--text); border-color: var(--text); }

.fs-types { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fs-type {
  height: 40px; padding: 0 6px; border-radius: 11px; cursor: pointer; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.fs-type img { width: 100%; max-height: 18px; object-fit: contain; border-radius: 3px; opacity: .5; filter: saturate(.6); transition: opacity .15s, filter .15s; }
.fs-type.on { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--holo) border-box; border: 1.5px solid transparent; }
.fs-type.on img { opacity: 1; filter: none; }
@media (hover: hover) { .fs-chip:hover, .fs-type:hover { border-color: var(--border-2); } .fs-type:hover img { opacity: .85; } }

.fs-locked { width: 100%; height: 42px; margin-top: 18px; text-align: left; background: var(--surface-2); }
.fs-actions { display: flex; gap: 8px; margin-top: 16px; }
.fs-actions button { flex: 1; height: 48px; border-radius: 14px; cursor: pointer; font-weight: 750; font-size: 14px; }
.fs-actions .rl-go { flex: 2; }

@media (max-width: 560px) {
  .toolbar-chips .filter-btn { order: -2; height: 40px; padding: 0 11px; border-radius: 11px; font-size: 12.5px; gap: 6px; white-space: nowrap; }
  .filter-btn svg { width: 15px; height: 15px; }
  /* Bottom sheet within thumb reach. */
  .filter-dlg { align-items: flex-end; padding: 0; }
  .filter-dlg .rl-card {
    width: 100%; max-height: calc(100dvh - 48px - env(safe-area-inset-top)); border-radius: 26px 26px 0 0; border-bottom: 0;
    padding: 22px 16px calc(14px + env(safe-area-inset-bottom)); animation: fsUp .3s cubic-bezier(.2, .9, .3, 1);
  }
  .fs-body { margin: 0 -16px; padding: 0 16px 4px; }
  .fs-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fs-type { height: 38px; }
  .fs-type img { max-height: 18px; }
  .fs-chip { flex: 1 1 auto; height: 40px; }
}
@keyframes fsUp { from { transform: translateY(40%); opacity: .4; } }
@media (pointer: coarse) { .fs-chip:active, .fs-type:active, .filter-btn:active { transform: scale(.96); transition: transform .08s; } }
