.toolbar-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .75rem;
  min-width: 0;
}

.mana-quick-filter {
  display: grid;
  min-width: 0;
  gap: .3rem;
}

.mana-quick-filter-label {
  color: var(--muted, currentColor);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.mana-quick-filter-scroll {
  display: flex;
  align-items: center;
  gap: .15rem;
  max-width: min(42rem, 58vw);
  padding: .22rem .3rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 5%, transparent);
}

.mana-quick-button {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: .08rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background-color .15s ease;
}

.mana-quick-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) saturate(0) brightness(.78);
  opacity: .68;
  transition: filter .15s ease, opacity .15s ease;
}

.mana-quick-button:hover,
.mana-quick-button:focus-visible {
  border-color: color-mix(in srgb, currentColor 40%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.mana-quick-button:focus-visible {
  outline: 2px solid var(--accent-color, var(--accent, #d7ae57));
  outline-offset: 2px;
}

.mana-quick-button[aria-pressed="true"] {
  border-color: #3d98ff;
  background: color-mix(in srgb, #3d98ff 14%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #3d98ff 20%, transparent), 0 0 14px color-mix(in srgb, #3d98ff 38%, transparent);
  transform: translateY(-1px);
}

.mana-quick-button.mana-zero[aria-pressed="true"] {
  border-color: #ff4d59;
  background: color-mix(in srgb, #ff4d59 14%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #ff4d59 20%, transparent), 0 0 14px color-mix(in srgb, #ff4d59 38%, transparent);
}

.mana-quick-button[aria-pressed="true"] img {
  filter: none;
  opacity: 1;
}

@media (max-width: 900px) {
  .results-toolbar,
  .toolbar-controls {
    align-items: stretch;
  }

  .toolbar-controls {
    flex-wrap: wrap;
    width: 100%;
  }

  .mana-quick-filter {
    flex: 1 1 100%;
    width: 100%;
  }

  .mana-quick-filter-scroll {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mana-quick-button,
  .mana-quick-button img {
    transition: none;
  }
}
